Continuously Deploying DNS records with DnsControl and CircleCI

In the previous post I gave a quick introduction to DnsControl, what it does and how it works. In this post, I’ll show you how to continuously deploy your changes to Google Cloud DNS using CircleCI. The goal is to have a Pipeline that works like this: On each push, run dnscontrol check to verify the file is valid, dnscontrol preview to make sure all configuration is correct (credentials, zones, …).

Managing DNS records the DevOps way

Managing DNS records has always been a bit of a hassle for me. Most DNS providers have some sort of web gui where you have to manually fiddle in all records manually. Besides the fact that this is really tedious, this is quite error-prone. Humans are horrible at doing manual work! So let’s automate this! My first iteration was moving everything to AWS Route53. Amazon provides APIs for all of their services, but unfortunately they are horribly complicated!

Make all *.local domains resolve to localhost

It’s time for my yearly blog post, so let’s get started! Some development environments use *.local-domains which point to localhost. Creating a hosts-entry for every single domain is not an elegant solution, so let’s do something easier: let’s use dnsmasq to resolve ALL .local-domains to localhost! Tested on CentOS 7, but should work similarly for other Linuxes. All commands assume you have root privileges. If you are not logged in as root, prepend sudo to all commands.