summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/dns-forwarding/vyatta-dns-forwarding.pl25
-rw-r--r--templates/service/dns/forwarding/domain/node.tag/server/node.def1
2 files changed, 9 insertions, 17 deletions
diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl
index 217a520a..b5efd269 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, @domains, $server, $ignore_hosts_file);
+ my (@listen_interfaces, $cache_size, @use_nameservers, $use_system_nameservers, @use_dhcp_nameservers, @domain, $server, $ignore_hosts_file);
$config->setLevel("service dns forwarding");
@@ -73,7 +73,7 @@ sub dnsforwarding_get_values {
@use_nameservers = $config->returnOrigValues("name-server");
$use_system_nameservers = $config->existsOrig("system");
@use_dhcp_nameservers = $config->returnOrigValues("dhcp");
- @domains = $config->listOrigNodes("domain");
+ @domain = $config->listOrigNodes("domain");
$ignore_hosts_file = $config->returnOrigValue("ignore-hosts-file");
} else {
@@ -82,7 +82,7 @@ sub dnsforwarding_get_values {
@use_nameservers = $config->returnValues("name-server");
$use_system_nameservers = $config->exists("system");
@use_dhcp_nameservers = $config->returnValues("dhcp");
- @domains = $config->listNodes("domain");
+ @domain = $config->listNodes("domain");
$ignore_hosts_file = $config->exists("ignore-hosts-file");
}
@@ -112,7 +112,7 @@ sub dnsforwarding_get_values {
my $sys_config = new Vyatta::Config;
$sys_config->setLevel("system");
my @system_nameservers;
- if ($outside_cli == 1) {
+ if ($outside_cli == 1){
@system_nameservers = $sys_config->returnOrigValues("name-server");
} else {
@system_nameservers = $sys_config->returnValues("name-server");
@@ -123,18 +123,11 @@ sub dnsforwarding_get_values {
}
}
}
- if (@domains != 0) {
- foreach my $domain (@domains) {
- my @domain_servers;
- if ($outside_cli == 1) {
- @domain_servers = $config->returnValues("domain $domain server");
- } else {
- @domain_servers = $config->returnValues("domain $domain server");
- }
- if (@domain_servers > 0) {
- foreach my $domain_server (@domain_servers) {
- $output .="server=/$domain/$domain_server\t# domain-override\n";
- }
+ 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";
}
}
}
diff --git a/templates/service/dns/forwarding/domain/node.tag/server/node.def b/templates/service/dns/forwarding/domain/node.tag/server/node.def
index 8f40a299..3dec7d5d 100644
--- a/templates/service/dns/forwarding/domain/node.tag/server/node.def
+++ b/templates/service/dns/forwarding/domain/node.tag/server/node.def
@@ -1,3 +1,2 @@
-multi:
type: ipv4
help: DNS server to forward queries