summaryrefslogtreecommitdiff
path: root/scripts/system/vyatta_update_resolv.pl
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2014-09-09 23:24:42 +0100
committerAlex Harpin <development@landsofshadow.co.uk>2014-09-09 23:24:42 +0100
commit2754e3a6792eae084067be002c2ecc47a9de0b3e (patch)
tree6435279bdb1cc00e923667fc87f1173d6b3a52cf /scripts/system/vyatta_update_resolv.pl
parent51fc24c24c8f3e9f893a7df550f755f9fc7d1d76 (diff)
downloadvyatta-cfg-system-2754e3a6792eae084067be002c2ecc47a9de0b3e.tar.gz
vyatta-cfg-system-2754e3a6792eae084067be002c2ecc47a9de0b3e.zip
vyatta-cfg-system: add 'set system allow-dhcp-nameservers' option
Instead of simply allowing / denying DHCP related updates to resolv.conf based on the current values of 'set system name-server', as initially proposed for Bug #182 (http://bugzilla.vyos.net/show_bug.cgi?id=182), this patch replaces that behaviour with a global option to allow / deny these updates. Add 'set system allow-dhcp-nameservers' as a boolean value that has the default value of true, so allowing DHCP nameserver updates by default. Bug #308 http://bugzilla.vyos.net/show_bug.cgi?id=308
Diffstat (limited to 'scripts/system/vyatta_update_resolv.pl')
-rwxr-xr-xscripts/system/vyatta_update_resolv.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/system/vyatta_update_resolv.pl b/scripts/system/vyatta_update_resolv.pl
index 6a60278b..ee14034b 100755
--- a/scripts/system/vyatta_update_resolv.pl
+++ b/scripts/system/vyatta_update_resolv.pl
@@ -94,8 +94,8 @@ if ($domain_name && length($domain_name) > 0) {
}
# update /etc/resolv.conf for name-servers received from dhcp client, only done when dhclient-script calls this script
-# and there aren't statically configured DNS settings, via 'set system name-server', in place.
-if (($dhclient_script == 1) && !($vc->existsOrig('name-server'))) {
+# and allow-dhcp-nameservers is set to true (default)
+if (($dhclient_script == 1) && ($vc->returnOrigValue('allow-dhcp-nameservers') eq "true")) {
my @current_dhcp_nameservers;
my $restart_ntp = 0;