mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-05-31 17:40:54 +00:00
fix SOA record check against secondary dns
This commit is contained in:
parent
05c2f3c9a2
commit
fed6998945
@ -550,8 +550,12 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
|
|||||||
continue
|
continue
|
||||||
# Choose the first IP if nameserver returns multiple
|
# Choose the first IP if nameserver returns multiple
|
||||||
ns_ip = ns_ips.split('; ')[0]
|
ns_ip = ns_ips.split('; ')[0]
|
||||||
|
|
||||||
checkSOA = True
|
# No need to check if we could not obtain the SOA record
|
||||||
|
if SOARecord == '[timeout]':
|
||||||
|
checkSOA = False
|
||||||
|
else:
|
||||||
|
checkSOA = True
|
||||||
|
|
||||||
# Now query it to see what it says about this domain.
|
# Now query it to see what it says about this domain.
|
||||||
ip = query_dns(domain, "A", at=ns_ip, nxdomain=None)
|
ip = query_dns(domain, "A", at=ns_ip, nxdomain=None)
|
||||||
@ -573,10 +577,10 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
|
|||||||
|
|
||||||
if SOARecord == SOASecondary:
|
if SOARecord == SOASecondary:
|
||||||
output.print_ok(f"Secondary nameserver {ns} has consistent SOA record.")
|
output.print_ok(f"Secondary nameserver {ns} has consistent SOA record.")
|
||||||
elif SOARecord == '[Not Set]':
|
elif SOASecondary == '[Not Set]':
|
||||||
output.print_error(f"Secondary nameserver {ns} has no SOA record configured.")
|
output.print_error(f"Secondary nameserver {ns} has no SOA record configured.")
|
||||||
elif SOARecord == '[timeout]':
|
elif SOASecondary == '[timeout]':
|
||||||
output.print_error(f"Secondary nameserver {ns} timed out on checking SOA record.")
|
output.print_warning(f"Secondary nameserver {ns} timed out on checking SOA record.")
|
||||||
else:
|
else:
|
||||||
output.print_error(f"""Secondary nameserver {ns} has inconsistent SOA record (primary: {SOARecord} versus secondary: {SOASecondary}).
|
output.print_error(f"""Secondary nameserver {ns} has inconsistent SOA record (primary: {SOARecord} versus secondary: {SOASecondary}).
|
||||||
Check that synchronization between secondary and primary DNS servers is properly set-up.""")
|
Check that synchronization between secondary and primary DNS servers is properly set-up.""")
|
||||||
|
Loading…
Reference in New Issue
Block a user