summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface-definitions/dns-forwarding.xml.in28
-rwxr-xr-xsrc/conf_mode/dns_forwarding.py4
2 files changed, 30 insertions, 2 deletions
diff --git a/interface-definitions/dns-forwarding.xml.in b/interface-definitions/dns-forwarding.xml.in
index 61f297f0a..de6991e06 100644
--- a/interface-definitions/dns-forwarding.xml.in
+++ b/interface-definitions/dns-forwarding.xml.in
@@ -277,6 +277,34 @@
#include <include/generic-disable-node.xml.i>
</children>
</tagNode>
+ <tagNode name="ns">
+ <properties>
+ <help>NS record</help>
+ <valueHelp>
+ <format>txt</format>
+ <description>A DNS name relative to the root record</description>
+ </valueHelp>
+ <constraint>
+ <regex>([-_a-zA-Z0-9.]{1,63}|@)(?&lt;!\.)</regex>
+ </constraint>
+ </properties>
+ <children>
+ <leafNode name="target">
+ <properties>
+ <help>Target DNS server authoritative for subdomain</help>
+ <valueHelp>
+ <format>nsXX.example.com</format>
+ <description>Absolute DNS name</description>
+ </valueHelp>
+ <constraint>
+ <regex>[-_a-zA-Z0-9.]{1,63}(?&lt;!\.)</regex>
+ </constraint>
+ </properties>
+ </leafNode>
+ #include <include/dns/time-to-live.xml.i>
+ #include <include/generic-disable-node.xml.i>
+ </children>
+ </tagNode>
<tagNode name="ptr">
<properties>
<help>PTR record</help>
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py
index b7214caf7..0d86c6a52 100755
--- a/src/conf_mode/dns_forwarding.py
+++ b/src/conf_mode/dns_forwarding.py
@@ -99,7 +99,7 @@ def get_config(config=None):
recorddata = zonedata['records']
- for rtype in [ 'a', 'aaaa', 'cname', 'mx', 'ptr', 'txt', 'spf', 'srv', 'naptr' ]:
+ for rtype in [ 'a', 'aaaa', 'cname', 'mx', 'ns', 'ptr', 'txt', 'spf', 'srv', 'naptr' ]:
if rtype not in recorddata:
continue
for subnode in recorddata[rtype]:
@@ -126,7 +126,7 @@ def get_config(config=None):
'ttl': rdata['ttl'],
'value': address
})
- elif rtype in ['cname', 'ptr']:
+ elif rtype in ['cname', 'ptr', 'ns']:
rdefaults = defaults(base + ['authoritative-domain', 'records', rtype]) # T2665
rdata = dict_merge(rdefaults, rdata)