diff options
author | Christian Breunig <christian@breunig.cc> | 2024-05-31 15:49:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-31 15:49:28 +0200 |
commit | c6a8522c4c20078bb33157fc803373bf3532a02b (patch) | |
tree | 875182c134f6b525db33a29a506face0ca44b707 /src | |
parent | 173deaa76ebaea2048e5f342013af6844979151f (diff) | |
parent | a4f632d97bbb2e633bb2461688cbf3bcbb0d9e17 (diff) | |
download | vyos-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-x | src/conf_mode/service_dns_forwarding.py | 15 |
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') |