if the machine didn't have resolvconf before (my box didn't after an upgrade from Ubuntu 13.xx), make sure it has it now and archive any old resolv.conf since it should now only list 127.0.0.1 for bind9

This commit is contained in:
Joshua Tauberer 2014-08-07 13:49:14 +00:00
parent 5db12be507
commit 880ec44a0c

View file

@ -56,7 +56,7 @@ fi
# name server, on IPV6. # name server, on IPV6.
# * The listen-on directive in named.conf.options restricts bind9 to # * The listen-on directive in named.conf.options restricts bind9 to
# binding to the loopback interface instead of all interfaces. # binding to the loopback interface instead of all interfaces.
apt_install bind9 apt_install bind9 resolvconf
tools/editconf.py /etc/default/bind9 \ tools/editconf.py /etc/default/bind9 \
RESOLVCONF=yes \ RESOLVCONF=yes \
"OPTIONS=\"-u bind -4\"" "OPTIONS=\"-u bind -4\""
@ -64,5 +64,10 @@ if ! grep -q "listen-on " /etc/bind/named.conf.options; then
# Add a listen-on directive if it doesn't exist inside the options block. # Add a listen-on directive if it doesn't exist inside the options block.
sed -i "s/^}/\n\tlisten-on { 127.0.0.1; };\n}/" /etc/bind/named.conf.options sed -i "s/^}/\n\tlisten-on { 127.0.0.1; };\n}/" /etc/bind/named.conf.options
fi fi
if [ -f /etc/resolvconf/resolv.conf.d/original ]; then
echo "Archiving old resolv.conf (was /etc/resolvconf/resolv.conf.d/original, now /etc/resolvconf/resolv.conf.original)."
mv /etc/resolvconf/resolv.conf.d/original /etc/resolvconf/resolv.conf.original
fi
restart_service bind9 restart_service bind9
restart_service resolvconf