1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-18 18:07:22 +01:00

Add download zonefile button to external DNS page (#1853)

Co-authored-by: Joshua Tauberer <jt@occams.info>
This commit is contained in:
Victor
2020-11-16 12:03:41 +01:00
committed by GitHub
parent 7fd35bbd11
commit b85b86e6de
5 changed files with 87 additions and 1 deletions

View File

@@ -564,6 +564,17 @@ $TTL 1800 ; default time to live
return True # file is updated
def get_dns_zonefile(zone, env):
for domain, fn in get_dns_zones(env):
if zone == domain:
break
else:
raise ValueError("%s is not a domain name that corresponds to a zone." % zone)
nsd_zonefile = "/etc/nsd/zones/" + fn
with open(nsd_zonefile, "r") as f:
return f.read()
########################################################################
def write_nsd_conf(zonefiles, additional_records, env):