A few months earlier, Cloudflare updated their DNS management console, and to be honest, I think they made their console worse: the loading time is longer than before, and it’s harder to add new records. At about the same time, I was thinking how to manage DNS records, because in our club, multiple people have management premission to the same domain, and I can’t find a overview page or something like that to tell me who did what changes to the domain. I need a tool to help me to manage those records.
As it turns out, Octodns is very easy and convenient to use, and I use it to manage DNS records for all my domains now.
To start using Octodns, you need to install it first. Create a folder, then use
virtualenv to install octodns
$ mkdir dns && cd ./dns
Now, you need to add config file for octodns, create a folder called
config and create file
The YAML above means
Octodnswill communicate with DynDNS and AWS Route53 to manage your DNS records.
Octodnswill look for
AWS_SECRET_ACCESS_KEYin you environment variable, so you don’t need to write your token into your YAML.
example.com, it will be looking for
Octodns support multiple DNS provider, like
DNSimple…and lots more, you can check if your provider is supported or not at octodns/provider.
Now, if you want to add record for
example.com, you need to create folder
resources in your
dns folder, not
configs folder, and create file
example.com.yaml, the config file should look like this:
This means the top domain (
example.com) will have a
A record, and the value of that
A record will be
If you’re done with your records, run
octodns-sync --config-file ./config/config.yaml to do a dry-run for your configuration, you can review what change you’re going to perform to the domain. And if everything looks good, add
--doit parameter to the command above, then
octodns will sync the records with DNS provider.
“Wait, what if I’m already using DNS provider to manage my DNS records? Do I need to write YAML for existing records first?”
octodns provides a tool called
octodns-dump to create a DNS records configuration YAML for you, so you don’t need to manually create records yourself, just dump it and you’re done. The command is
octodns-dump --config-file=config/config.yaml --output-dir=resources/ example.com. route53. The command will dump records for
example.com from Route53, and create a file called
example.com.yaml in folder
The main reason for using DNS manager like this is, imagine you are in a team around 10 people, and everyone have the permission to modify DNS records, if there are no tools to manage and review changes for DNS records, it will be hard to trace changes.
octodns a shot, I think you will love it.