DNSControl

I’ve found a really nice post describing how someone moved their DNS from Amazon Route53 to Hetzner … and given multiple reasons, I gave it a try. For reasons:

  • reduce reliance on US technology (well, at least the smallest bits),
  • I’m paying $0.54 per month for a domain that has super low traffic,
  • I’m trying to make one step closer towards Infrastructure as a Service: and this is one area where managing configuration as code makes life so much easier (what was I trying to do here? ah … this is how I did it …).

Overall, really nice and also learning a bit on the way. Had trouble just with R53_ALIAS, which was pointing the apex of the domain to a CloudFront distribution address, which Hetzner doesn’t support.

The gist of the solution:

  1. a git repository, with dnsconfig.js, obtained with the get-zones command. A small detail here, credentials stored as well in the repository, but encrypted with git-crypt – and had a really nice surprise: I can configure and manage both domains at Namecheap and Hetzner with a single solution.
  2. manual adjustments, and liberal use of dnscontrol preview
  3. once happy (and everything passing), dnscontrol push
  4. changing the NS for the domain to Hetzner
  5. manually going and deleting the zone from Amazon.