From 880ec44a0c3a1ff69b1920e1d062f9293ee45561 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Thu, 7 Aug 2014 13:49:14 +0000 Subject: [PATCH] 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 --- setup/system.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup/system.sh b/setup/system.sh index 42cb0b3..8e7d5c5 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -56,7 +56,7 @@ fi # name server, on IPV6. # * The listen-on directive in named.conf.options restricts bind9 to # binding to the loopback interface instead of all interfaces. -apt_install bind9 +apt_install bind9 resolvconf tools/editconf.py /etc/default/bind9 \ RESOLVCONF=yes \ "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. sed -i "s/^}/\n\tlisten-on { 127.0.0.1; };\n}/" /etc/bind/named.conf.options 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 resolvconf