take hidden master dns into account for the status checks

This commit is contained in:
github@kiekerjan.isdronken.nl 2021-05-24 21:32:13 +02:00
parent d88d7d0371
commit 1d96be9ea9
1 changed files with 10 additions and 0 deletions

View File

@ -503,7 +503,17 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
secondary_ns = custom_secondary_ns or ["ns2." + env['PRIMARY_HOSTNAME']]
existing_ns = query_dns(domain, "NS")
correct_ns = "; ".join(sorted(["ns1." + env['PRIMARY_HOSTNAME']] + secondary_ns))
# Take hidden master dns into account, the mail-in-a-box is not known as nameserver in that case
if os.path.exists("/etc/usehiddenmasterdns") and len(secondary_ns) > 1:
with open("/etc/usehiddenmasterdns") as f:
for line in f:
if line.strip() == domain or line.strip() == "usehiddenmasterdns":
correct_ns = "; ".join(sorted(secondary_ns))
break
ip = query_dns(domain, "A")
probably_external_dns = False