Skip to content

Copy DNS records from DigitalOcean to Name.com

License

Notifications You must be signed in to change notification settings

cdzombak/dns-do-to-namecom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DigitalOcean-to-Name.com DNS Migrator

Copy DNS records from DigitalOcean to Name.com.

This is a very simple tool intended for one-time migrations with a human involved in the process; it is not sufficiently robust to work without supervision or to be run repeatedly.

In particular, this tool is not idempotent:

  • It will attempt to copy every record, every time it is run, without regard for whether a similar record already exists in the destination.
  • In the event of a failure partway through a migration, this tool will not resume from where it left off; it will start over from the beginning.

This tool will not edit or remove existing records in Name.com under any circumstances.

Build

Because this is a one-off tool for occasional use, I'm not providing a CI pipeline or prebuilt binaries/Docker images. To get a binary, check out the repo and build it:

git clone https://github.com/cdzombak/dns-do-to-namecom.git
cd dns-do-to-namecom
go build -o out .

The only requirement is a working Go installation.

Usage

DO_API_TOKEN=dop_v1_foobarbaz \
NC_USERNAME=myusername \
NC_API_TOKEN=abcd0000 \
./out/dns-do-to-namecom -domain MYDOMAIN.COM [-dry-run=false] 
  • Flag -domain: The domain name for DNS migration.
  • Flag -dry-run: If true, the tool will not make any changes to Name.com; it will only print what it would do. True by default; you must pass -dry-run=false to make any changes to Name.com.
  • Environment variable DO_API_TOKEN: DigitalOcean API token with read access.
  • Environment variable NC_USERNAME: Name.com username.
  • Environment variable NC_API_TOKEN: Name.com API token.

Configuration

Environment variables may be placed in the special file .env. This file will be read automatically from the working directory if it exists. See env.sample for an example.

API Tokens/Management

License

LGPL 3.0; see LICENSE in this repository.

Author

Chris Dzombak (dzombak.com; GitHub @cdzombak)

See Also