summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-31 15:49:28 +0200
committerGitHub <noreply@github.com>2024-05-31 15:49:28 +0200
commitc6a8522c4c20078bb33157fc803373bf3532a02b (patch)
tree875182c134f6b525db33a29a506face0ca44b707 /src
parent173deaa76ebaea2048e5f342013af6844979151f (diff)
parenta4f632d97bbb2e633bb2461688cbf3bcbb0d9e17 (diff)
downloadvyos-1x-c6a8522c4c20078bb33157fc803373bf3532a02b.tar.gz
vyos-1x-c6a8522c4c20078bb33157fc803373bf3532a02b.zip
Merge pull request #3568 from vyos/mergify/bp/sagitta/pr-3557
dns: T6422: allow multiple redundant NS records (backport #3557)
Diffstat (limited to 'src')
-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')