summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-06-11 08:34:39 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-06-11 22:10:47 +0200
commite8da1c87f158898cdeb0ca3a16127701c7e8e28b (patch)
tree6ab0ca9b5ac9d72ff4fbfcb7c19a37741ffb8daf
parent7f2007964991b95166f4ab1255a57f4652c554ec (diff)
downloadvyos-1x-e8da1c87f158898cdeb0ca3a16127701c7e8e28b.tar.gz
vyos-1x-e8da1c87f158898cdeb0ca3a16127701c7e8e28b.zip
dns forwarding: T2486: change internal handling of 'system' config node
Remove manual retrieval of 'system name-server' from config and adding it to the name servers list, as this is now handled by simply adding a 'system' tag in vyos-hostsd.
-rwxr-xr-xsrc/conf_mode/dns_forwarding.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py
index 959c09bf8..5ee8c53c2 100755
--- a/src/conf_mode/dns_forwarding.py
+++ b/src/conf_mode/dns_forwarding.py
@@ -41,6 +41,7 @@ default_config_data = {
'listen_address': [],
'name_servers': [],
'negative_ttl': 3600,
+ 'system': False,
'domains': {},
'dnssec': 'process-no-validate'
}
@@ -86,16 +87,7 @@ def get_config(conf):
conf.return_values(['name-server']))
if conf.exists(['system']):
- conf.set_level(['system'])
- system_name_servers = []
- system_name_servers = conf.return_values(['name-server'])
- if not system_name_servers:
- print("DNS forwarding warning: No name-servers set under 'system name-server'\n")
- else:
- dns['name_servers'] = dns['name_servers'] + system_name_servers
- conf.set_level(base)
-
- dns['name_servers'] = bracketize_ipv6_addrs(dns['name_servers'])
+ dns['system'] = True
if conf.exists(['listen-address']):
dns['listen_address'] = conf.return_values(['listen-address'])