Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcmillien/3c28eb93fc46fdd8d25537da927c824c to your computer and use it in GitHub Desktop.
Save marcmillien/3c28eb93fc46fdd8d25537da927c824c to your computer and use it in GitHub Desktop.
#!/bin/bash
apt-get update
apt-get install bind9
cat <<EOF > /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
forwarders {
8.8.8.8;
8.8.4.4;
208.67.220.220;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { none; };
listen-on { 127.0.0.1; 10.9.8.1; 172.17.0.1; };
};
EOF
/etc/init.d/bind9 restart
echo 'nameserver 127.0.0.1' > /etc/resolv.conf
/etc/init.d/dns-clean restart
sed -i -e 's/#prepend domain-name-servers 127.0.0.1;/prepend domain-name-servers 127.0.0.1;/g' /etc/dhcp/dhclient.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment