Created
March 14, 2019 11:12
-
-
Save electric380v/0ccdb15316ff2ac43aba93889253222d to your computer and use it in GitHub Desktop.
bind-consul.sh
This file contains hidden or 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