diff options
Diffstat (limited to 'src/conf-mode')
-rwxr-xr-x | src/conf-mode/vyos-config-dns-forwarding.py | 11 |
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") |