Skip to content

Commit

Permalink
cleanup secondary NS check
Browse files Browse the repository at this point in the history
  • Loading branch information
kiekerjan committed Apr 1, 2024
1 parent be7434e commit b9b1b7a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions management/status_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,7 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
# Check that each custom secondary nameserver resolves the IP address.

if custom_secondary_ns and not probably_external_dns:
SOARecordTwo = query_dns(domain, "SOA") # This has caching?
SOARecord = query_dns(domain, "SOA", at=env['PUBLIC_IP'])# Explicitly ask the local dns server. But does it end up at Unbound or NSD?
if not SOARecord == SOARecordTwo:
output.print_error(f"Different SOA records {SOARecord} vs {SOARecordTwo}")
SOARecord = query_dns(domain, "SOA", at=env['PUBLIC_IP'])# Explicitly ask the local dns server.

for ns in custom_secondary_ns:
# We must first resolve the nameserver to an IP address so we can query it.
Expand Down Expand Up @@ -573,7 +570,7 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
elif SOARecord == '[Not Set]':
output.print_error(f"Secondary nameserver {ns} has no SOA record configured.")
elif SOARecord == '[timeout]':
output.print_error(f"Secondary nameserver {ns} did not return SOA record but: {SOASecondary}.")
output.print_error(f"Secondary nameserver {ns} timed out on checking SOA record.")
else:
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.""")
Expand Down

0 comments on commit b9b1b7a

Please sign in to comment.