diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2015-02-09 21:01:35 +0000 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2015-02-24 22:34:39 +0000 |
commit | 57cc55d8bab4640f8245ececa03b115a1524197f (patch) | |
tree | 1d09ee21003653f1eabf66e837660d04cc0cb901 /scripts | |
parent | ad79079808876ed0161ab4d8933d66a86f93a6bd (diff) | |
download | vyatta-cfg-system-57cc55d8bab4640f8245ececa03b115a1524197f.tar.gz vyatta-cfg-system-57cc55d8bab4640f8245ececa03b115a1524197f.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-x | scripts/system/vyatta_update_resolv.pl | 6 |
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; } } |