Created
September 9, 2015 19:01
-
-
Save wfaler/30b7d2ab5d97ae25416c to your computer and use it in GitHub Desktop.
use consul as DNS for local services, fronted by Bind for the rest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install bind9 bind9utils bind9-doc | |
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip | |
/etc/bind/named.conf.options: | |
options { | |
directory "/var/cache/bind"; | |
recursion yes; | |
allow-query { localhost; }; | |
forwarders { | |
8.8.8.8; | |
8.8.4.4; | |
}; | |
dnssec-enable no; | |
dnssec-validation no; | |
auth-nxdomain no; # conform to RFC1035 | |
listen-on-v6 { any; }; | |
}; | |
include "/etc/bind/consul.conf"; | |
--- /etc/bind/consul.conf: | |
zone "consul" IN { | |
type forward; | |
forward only; | |
forwarders { 127.0.0.1 port 8600; }; | |
}; | |
Start consul, something like: | |
./consul agent -server -bootstrap-expect 1 -data-dir [data-dir] -config-dir [config-dir] | |
sudo service bind9 restart | |
-- /etc/resolv.conf: | |
nameserver 127.0.0.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment