diff options
author | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2011-11-09 16:41:34 -0800 |
---|---|---|
committer | Gaurav Sinha <gaurav.sinha@vyatta.com> | 2011-11-09 16:41:34 -0800 |
commit | 4ada945314b7779e84d0059ed2ffeda2da44a78d (patch) | |
tree | 860e851f4f6999e0d0cd3c03c73b9fd406047bd6 /scripts/dns-forwarding/vyatta-dns-forwarding.pl | |
parent | f993ea0c32500b4754d4e0f76ecac67eec744796 (diff) | |
download | vyatta-cfg-quagga-4ada945314b7779e84d0059ed2ffeda2da44a78d.tar.gz vyatta-cfg-quagga-4ada945314b7779e84d0059ed2ffeda2da44a78d.zip |
Adding CLI option for domain overrides for DNS forwarding, bug id 4086
Diffstat (limited to 'scripts/dns-forwarding/vyatta-dns-forwarding.pl')
-rwxr-xr-x | scripts/dns-forwarding/vyatta-dns-forwarding.pl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl index 60abc53f..5714d293 100755 --- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl +++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl @@ -63,7 +63,7 @@ sub dnsforwarding_get_values { my $output = ''; my $config = new Vyatta::Config; my $use_dnsmasq_conf = 0; - my (@listen_interfaces, $cache_size, @use_nameservers, $use_system_nameservers, @use_dhcp_nameservers); + my (@listen_interfaces, $cache_size, @use_nameservers, $use_system_nameservers, @use_dhcp_nameservers, @domain, $server); $config->setLevel("service dns forwarding"); @@ -73,6 +73,7 @@ sub dnsforwarding_get_values { @use_nameservers = $config->returnOrigValues("name-server"); $use_system_nameservers = $config->existsOrig("system"); @use_dhcp_nameservers = $config->returnOrigValues("dhcp"); + @domain = $config->listOrigNodes("domain"); } else { @listen_interfaces = $config->returnValues("listen-on"); @@ -80,6 +81,7 @@ sub dnsforwarding_get_values { @use_nameservers = $config->returnValues("name-server"); $use_system_nameservers = $config->exists("system"); @use_dhcp_nameservers = $config->returnValues("dhcp"); + @domain = $config->listNodes("domain"); } if (@listen_interfaces != 0) { @@ -115,6 +117,14 @@ sub dnsforwarding_get_values { } } } + if (@domain != 0) { + foreach my $dom (@domain) { + my $ser = $config->returnValue("domain $dom server"); + if (defined ($ser)) { + $output .="server=/$dom/$ser\t# domain-override\n"; + } + } + } if (@use_dhcp_nameservers != 0) { $use_dnsmasq_conf = 1; |