summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-31 11:39:00 +0200
committerGitHub <noreply@github.com>2024-05-31 11:39:00 +0200
commitea477ed0cec87041cb94c0eb2bc2ce9523a92a0a (patch)
tree2afa662aeb1dbb3f42fe6c26fbd6ed8b2058c976 /src/conf_mode
parent5563bcd9eaef5d5d8a020b92d43a86028e3c26c1 (diff)
parentf2d0701f50061374b5a4f55d33201629b3293248 (diff)
downloadvyos-1x-ea477ed0cec87041cb94c0eb2bc2ce9523a92a0a.tar.gz
vyos-1x-ea477ed0cec87041cb94c0eb2bc2ce9523a92a0a.zip
Merge pull request #3557 from haimgel/T6422/allow-multiple-ns-records
dns: T6422: allow multiple redundant NS records
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/service_dns_forwarding.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/conf_mode/service_dns_forwarding.py b/src/conf_mode/service_dns_forwarding.py
index 7e863073a..70686534f 100755
--- a/src/conf_mode/service_dns_forwarding.py
+++ b/src/conf_mode/service_dns_forwarding.py
@@ -102,7 +102,7 @@ def get_config(config=None):
'ttl': rdata['ttl'],
'value': address
})
- elif rtype in ['cname', 'ptr', 'ns']:
+ elif rtype in ['cname', 'ptr']:
if not 'target' in rdata:
dns['authoritative_zone_errors'].append(f'{subnode}.{node}: target is required')
continue
@@ -113,6 +113,19 @@ def get_config(config=None):
'ttl': rdata['ttl'],
'value': '{}.'.format(rdata['target'])
})
+ elif rtype == 'ns':
+ if not 'target' in rdata:
+ dns['authoritative_zone_errors'].append(f'{subnode}.{node}: at least one target is required')
+ continue
+
+ for target in rdata['target']:
+ zone['records'].append({
+ 'name': subnode,
+ 'type': rtype.upper(),
+ 'ttl': rdata['ttl'],
+ 'value': f'{target}.'
+ })
+
elif rtype == 'mx':
if not 'server' in rdata:
dns['authoritative_zone_errors'].append(f'{subnode}.{node}: at least one server is required')