summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-02-09 21:01:35 +0000
committerAlex Harpin <development@landsofshadow.co.uk>2015-02-09 22:08:03 +0000
commit865bfab01e256ce839991a1b9d54f3e4cb62a8ac (patch)
tree93d8a33846b8ea8bad7e24e1f7a0c3b00b3f01c0 /scripts
parent6c147ff5db351fef80b8f1447b729bc03ddab6a2 (diff)
downloadvyatta-cfg-system-865bfab01e256ce839991a1b9d54f3e4cb62a8ac.tar.gz
vyatta-cfg-system-865bfab01e256ce839991a1b9d54f3e4cb62a8ac.zip
vyatta-cfg-system: invalid resolv.conf format causing extra DNS request
The resolv.conf file contains comments at the end of the search and domain entries which cause unexpected behaviour on lookups. Moving these to the line above in each case fixes the issue. Bug #468 http://bugzilla.vyos.net/show_bug.cgi?id=468
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/system/vyatta_update_resolv.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/system/vyatta_update_resolv.pl b/scripts/system/vyatta_update_resolv.pl
index 921052f0..93e6041d 100755
--- a/scripts/system/vyatta_update_resolv.pl
+++ b/scripts/system/vyatta_update_resolv.pl
@@ -96,12 +96,12 @@ if (!defined($domain_name)) {
my $search = '';
if (length($doms) > 0) {
- $search = "search\t\t$doms\t\t#line generated by $0\n";
+ $search = "#line generated by $0\nsearch\t\t$doms\n";
}
my $domain = '';
if ($domain_name && length($domain_name) > 0) {
- $domain = "domain\t\t$domain_name\t\t#line generated by $0\n";
+ $domain = "#line generated by $0\ndomain\t\t$domain_name\n";
}
# update /etc/resolv.conf with name-servers received from dhcp client, done when this script is called
@@ -221,7 +221,7 @@ foreach my $line (@resolv) {
if (length($domain) > 0) {
print $r $domain;
}
- } else {
+ } elsif ($line !~ /^#line generated by\s/) {
print $r $line;
}
}