Skip to content

Instantly share code, notes, and snippets.

@necromant2005
Forked from wfaler/bind-consul.sh
Created October 12, 2015 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save necromant2005/bb6a62e3551c8790e7a9 to your computer and use it in GitHub Desktop.
Save necromant2005/bb6a62e3551c8790e7a9 to your computer and use it in GitHub Desktop.
use consul as DNS for local services, fronted by Bind for the rest
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