I was tired of handling zone files. DNS Management is hard, especially if you manage tons of records with several registrars and many DNS providers. I manage DNS configuration with StackOverflow's DNSControl and Git.
Your DNS configuration is unique as your ecosystem. These are mine. Fork this repository and make it your own.
I don't believe in security by obscurity and I ❤️ Github.
Don't expect too much, this is my opinionated DNS configuration for my own projects.
I can easily backup, and restore settings for my personal sites. Furthermore, I can share what I have learned and grab new tricks from the community. Refer to my documentation, to setup vanity name servers on Route 53 — I spent more time than I'd like to admit on this topic.
- Install Golang with Homebrew:
brew update; brew install golang
- Validate GO version and location (DNSControl can be built with Go version 1.7 or higher):
which go;go version
- Ensure the environment variables are adequate (DNSControl will be installed in $GOPATH/bin):
export GOPATH=$HOME/go
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
- Create your GO workspace:
mkdir -p $GOPATH $GOPATH/src $GOPATH/pkg $GOPATH/b
- Download the source, compile it, and install DNSControl:
go get github.com/StackExchange/dnscontrol
- Create your dnsControl repository:
mkdir -p ~/Code/dnsConfiguration
- Clone my repository:
git clone https://github.com/bhdicaire/dnsConfiguration ~/Code/dnsConfiguration
- Create your initial
creds.json
with your own credential, you can usesamples/creds.json
to accelerate your setup - Modify the
dnsconfig.js
with your provider and DNS zones settings:- I'm currently using AWS Route53 as service provider and no registrar
- Refer to the Documentation for the language spec
-
Get an api token or api key from your DNS provider or registrar, the currently supported providers all have their own ways of doing this but you should look at restricting the key/token to only make DNS changes.
-
Fill out the
creds.json
file with your key/token, each provider requires a different name for their credentials so you should look at the documentation provided.
Refer to lib/example.js
,
Check that your provider is supported! Click on "Use this Template" to make a copy of this repository Update dnscontrol.js to use your provider and include your domain records (using the migration guide linked below) Rename creds.example.json to creds.json and update for your chosen provider (DON'T COMMIT THIS) Use dnscontrol preview to check that everything is setup correctly - if you're simply migrating this shouldn't find any changes Now you're ready to make changes via DNScontrol!
- Modify the configuration file with your favorite text editor
- Identify the next step with
make help
:
test Read configuration and identify changes to be made, without applying them
debug Run test above and check configuration
build Deploy configuration to DNS servers
push Build above and commit changes to Git, you may use msg=abc or ticket=123
archive Build above, copy configuration to archive subfolder, and commit to Git
clean Delete dnsConfig.json and archive subfolder
help This information
- Test your changes with
make test
or usemake debug
if you're stuck - Fix all all warnings/ errors with your favorite text editor
- Deploy the compiled configuration to your dns servers with
make build
- When everything is perfect, deploy the change one more time and commit the change to Git:
make push
ormake push msg="Add Dicaire.com"
ormake push ticket=A123456
- Close your change management ticket 😁
DNS Control is Copyright 2015 Stack Overflow and licensed under the MIT licence.
dnsConfiguration is Copyright 2018 Benoît H. Dicaire and licensed under the MIT licence.
- Introducing DNS Control and the USENIX presentation
- Github source repository: StackExchange/dnscontrol