https://github.com/arvid-berndtsson/namecheap-dns

https://github.com/arvid-berndtsson/namecheap-dns

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: arvid-berndtsson
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 6.84 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

Export/import DNS records from/to Namecheap

This script lets you move DNS records from a Namecheap domain to a YAML file or from a YAML file to Namecheap. This is a great way to keep track of your Namecheap DNS records with a change history, almost like having a code for your settings.

But, the Namecheap API doesn't let you make, change, or delete records one by one. It only lets you replace all records for a domain at once. The best way to use this script is to first move all current records to a file. Then, edit this file to add any changes you want. Finally, move the changed file back to Namecheap.

You should do a test run with --dryrun to check everything works.

To use the script, start by enabling the Namecheap API in your account, make sure to also whitelist the IPv4 address you are running the script on. This will let the script access your account.

Configuration

You need a configuration file. It's usually called dns-config.yml and located in the current directory. However, you can use a different file if you specify it on the command line. Here's how the contents of this file should look: yml ApiUser: [Namecheap username] UserName: [Namecheap username] ApiKey: [Namecheap API key] ClientIP: [Public IPv4 address of the host you're running the script on]

YAML file format

The YAML file containing the records looks like this: yaml - Address: 127.0.0.1 HostName: localhost RecordType: A TTL: '180' - Address: 192.168.0.1 HostName: router RecordType: A - Address: email.my.domain MXPref: 10 HostName: '@' RecordType: MX It doesn't matter what order the records or fields in each record are in.

Usage

The script has a few options. You can see them all with main.py -h. Here's a summary: shell main.py [-h] [--config CONFIG]

Import

This command moves all records for a domain to a YAML file. You can use --dryrun to see what would happen without actually doing it. You can use --input-file to specify a different file to write to. shell main.py import [-h] [--dryrun] [--input-file INPUT_FILE] domain

Export

shell main.py export [-h] [--output-file OUTPUT_FILE] domain

Owner

  • Name: Arvid Berndtsson
  • Login: arvid-berndtsson
  • Kind: user
  • Location: Sweden
  • Company: @LimeTip

Based in Malmö, Sweden, I specialize in software development and digital sustainability. Founder of @LimeTip and Co-Founder of @merely-emissions

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels