diff --git a/management/daemon.py b/management/daemon.py index ceabd3a9..83368374 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -1,3 +1,5 @@ +#!/usr/local/lib/mailinabox/env/bin/python3 + import os, os.path, re, json, time import multiprocessing.pool, subprocess @@ -342,7 +344,10 @@ def dns_get_dump(): @authorized_personnel_only def dns_get_zonefile(zone): from dns_update import get_dns_zonefile - return json_response(get_dns_zonefile(zone, env)) + zonefile = get_dns_zonefile(zone, env) + response = make_response(zonefile, 200) + response.mimetype = "text/plain" + return response # SSL diff --git a/management/dns_update.py b/management/dns_update.py index 01d81121..ccca69cd 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -569,9 +569,9 @@ def get_dns_zonefile(zone, env): if zone == domain: break else: - raise ValueError("%s is not a domain name or a subdomain of a domain name managed by this box." % zone) + raise ValueError("%s is not a domain name that corresponds to a zone." % zone) - nsd_zonefile = "/etc/nsd/zones/" + zone + ".txt" + nsd_zonefile = "/etc/nsd/zones/" + fn with open(nsd_zonefile, "r") as f: return f.read() diff --git a/management/templates/custom-dns.html b/management/templates/custom-dns.html index 224fa3d3..b1b98b9b 100644 --- a/management/templates/custom-dns.html +++ b/management/templates/custom-dns.html @@ -99,23 +99,6 @@ -
You can download your zonefiles here, for example if you want to host your DNS somewhere else.
- -named-checkzone
to validate your zone file.
+You can download your zonefiles here or use the table of records below.
+ + +