summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-06-11 08:36:08 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-06-11 22:10:47 +0200
commitf02f9622307687282aeca2600953cf6394f09485 (patch)
treee629c11eefa7f4e690a5be49dc8e39d480c62e65 /src
parente8da1c87f158898cdeb0ca3a16127701c7e8e28b (diff)
downloadvyos-1x-f02f9622307687282aeca2600953cf6394f09485.tar.gz
vyos-1x-f02f9622307687282aeca2600953cf6394f09485.zip
dns forwarding: T2486: change internal handling of 'dhcp' nameservers
Remove the old solution that retrieved dhcp tagged nameservers from hostsd and added it to nameservers, as it didn't work anyway (only once during configuration but it didn't update them later). This is now handled by vyos-hostsd, just retrieve the configured interfaces and send it the list of tags to use.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/dns_forwarding.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py
index 5ee8c53c2..556947733 100755
--- a/src/conf_mode/dns_forwarding.py
+++ b/src/conf_mode/dns_forwarding.py
@@ -43,7 +43,8 @@ default_config_data = {
'negative_ttl': 3600,
'system': False,
'domains': {},
- 'dnssec': 'process-no-validate'
+ 'dnssec': 'process-no-validate',
+ 'dhcp_interfaces': []
}
@@ -95,20 +96,8 @@ def get_config(conf):
if conf.exists(['dnssec']):
dns['dnssec'] = conf.return_value(['dnssec'])
- # Add name servers received from DHCP
if conf.exists(['dhcp']):
- interfaces = []
- interfaces = conf.return_values(['dhcp'])
- hc = hostsd_client()
-
- for interface in interfaces:
- dhcp_resolvers = hc.get_name_servers(f'dhcp-{interface}')
- dhcpv6_resolvers = hc.get_name_servers(f'dhcpv6-{interface}')
-
- if dhcp_resolvers:
- dns['name_servers'] = dns['name_servers'] + dhcp_resolvers
- if dhcpv6_resolvers:
- dns['name_servers'] = dns['name_servers'] + dhcpv6_resolvers
+ dns['dhcp_interfaces'] = conf.return_values(['dhcp'])
return dns