Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns-reports.py - AAAA - "NoNameservers: All nameservers failed to answer the query" #109

Open
falz opened this issue Sep 5, 2024 · 1 comment

Comments

@falz
Copy link

falz commented Sep 5, 2024

Odd behaviour running the Check_DNS_AAAA_Record report in Netbox 4.0.10. Check_DNS_A_Record runs just fine.

We get:

NoNameservers: All nameservers failed to answer the query 1ru\032AC\032PDU\032A.

1ru AC PDU A is the device name (1ru\032AC\032PDU\032A is with spacing characters). It has no A nor AAAA nor any IP address at all- yet the script seems to be attempting to resolve it.

The A record (ipv4) report properly logs an info No IP or DNS found. for this. But for AAAA it pukes with:

An exception occurred: NoNameservers: All nameservers failed to answer the query 1ru\032AC\032PDU\032A. IN AAAA: Server Do53:127.0.0.53@53 answered SERVFAIL

Traceback (most recent call last):
  File "/opt/netbox/netbox-4.0.11/netbox/extras/scripts.py", line 662, in _run_script
    script.output = script.run(data, commit)
  File "/opt/netbox/netbox-4.0.11/netbox/extras/scripts.py", line 415, in run
    self.run_tests()
  File "/opt/netbox/netbox-4.0.11/netbox/extras/scripts.py", line 578, in run_tests
    raise e
  File "/opt/netbox/netbox-4.0.11/netbox/extras/scripts.py", line 573, in run_tests
    test_method()
  File "/opt/netbox/netbox-4.0.11/netbox/scripts/dns-reports.py", line 61, in test_dns_aaaa_record
    aaaa = dns.resolver.query(device.name, "AAAA")
  File "/opt/netbox/current/venv/lib/python3.10/site-packages/dns/resolver.py", line 1598, in query
    return resolve(
  File "/opt/netbox/current/venv/lib/python3.10/site-packages/dns/resolver.py", line 1565, in resolve
    return get_default_resolver().resolve(
  File "/opt/netbox/current/venv/lib/python3.10/site-packages/dns/resolver.py", line 1318, in resolve
    (nameserver, tcp, backoff) = resolution.next_nameserver()
  File "/opt/netbox/current/venv/lib/python3.10/site-packages/dns/resolver.py", line 763, in next_nameserver
    raise NoNameservers(request=self.request, errors=self.errors)
dns.resolver.NoNameservers: All nameservers failed to answer the query 1ru\032AC\032PDU\032A. IN AAAA: Server Do53:127.0.0.53@53 answered SERVFAIL

image

@falz
Copy link
Author

falz commented Sep 5, 2024

Did a tcpdump to confirm what's happening - indeed SRVFAIL is true. This is just some ubuntu server with the default local resolver. I suspect there just needs to be better error handling added for NoNameservers (?)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant