summaryrefslogtreecommitdiff
path: root/src/conf-mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-03-16 21:40:41 +0100
committerChristian Poessinger <christian@poessinger.com>2018-04-15 17:50:57 +0200
commitd08fbff714dbff0ae7b914a55e58ee141042c4f0 (patch)
treef7926beacfaa57c7b7b7c12c24cee6bbc39be62c /src/conf-mode
parent28c3a6385143c97c3255f2a476523b103d3b830d (diff)
downloadvyos-1x-d08fbff714dbff0ae7b914a55e58ee141042c4f0.tar.gz
vyos-1x-d08fbff714dbff0ae7b914a55e58ee141042c4f0.zip
dns-forwarding.py: add missing 'query-all-servers' path
Diffstat (limited to 'src/conf-mode')
-rwxr-xr-xsrc/conf-mode/vyos-config-dns-forwarding.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/conf-mode/vyos-config-dns-forwarding.py b/src/conf-mode/vyos-config-dns-forwarding.py
index cdbd89eba..742e111cb 100755
--- a/src/conf-mode/vyos-config-dns-forwarding.py
+++ b/src/conf-mode/vyos-config-dns-forwarding.py
@@ -85,6 +85,9 @@ def get_config():
nameservers = conf.return_values('name-server')
dns.setdefault('name-server', nameservers)
+ if conf.exists('query-all-servers'):
+ dns.setdefault('query-all-servers', True)
+
if conf.exists('system'):
conf.set_level('system')
nameservers = []
@@ -96,8 +99,9 @@ def get_config():
return dns
def verify(dns):
- if 'listen-on' not in dns.keys():
- raise ConfigError("Error: DNS forwarding requires a configured listen interface!")
+ if len(dns) > 0:
+ if 'listen-on' not in dns.keys():
+ raise ConfigError("Error: DNS forwarding requires a configured listen interface!")
return None
@@ -135,6 +139,9 @@ def generate(dns):
for nameserver in dns['name-server']:
f.write("server={0}\t# statically configured\n".format(nameserver))
+ if 'query-all-servers' in dns.keys():
+ f.write("all-servers\n")
+
if 'system-name-server' in dns.keys():
# Read the IP addresses of the upstream nameservers from /etc/resolv.conf
f.write("resolv-file=/etc/resolv.conf\n")