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

Handled exception for dns.resolver.NoNameservers #83

Merged
merged 1 commit into from
Nov 16, 2018

Conversation

mazen160
Copy link
Contributor

Summary

When an NS query does not return nameservers, this exception is raised. However, it was not handled, which led to the crash of the program.

This commit handles this exception.

When an NS query does not return nameservers, this exception is raised. However, it was not handled, which led to the crash of the program.
This commit handles this exception.
@mazen160
Copy link
Contributor Author

An example of the exception (for reference)

dnsrecon -d [redacted]
[*] Performing General Enumeration of Domain: [redacted]
[-] All nameservers failed to answer the DNSSEC query for [redacted]
[-] Error while resolving SOA record.
Traceback (most recent call last):
  File "./dnsrecon.py", line 1691, in <module>
    main()
  File "./dnsrecon.py", line 1649, in main
    std_enum_records = general_enum(res, domain, xfr, goo, bing, spf_enum, do_whois, do_crt, zonewalk)
  File "./dnsrecon.py", line 960, in general_enum
    for ns_rcrd in res.get_ns():
  File "/usr/share/dnsrecon/lib/dnshelper.py", line 174, in get_ns
    answer = self._res.query(self._domain, 'NS')
  File "/usr/lib/python2.7/dist-packages/dns/resolver.py", line 947, in query
    raise NoNameservers(request=request, errors=errors)
dns.resolver.NoNameservers: All nameservers failed to answer the query [redacted]. IN NS: Server [redacted] UDP port 53 answered SERVFAIL

@mazen160
Copy link
Contributor Author

Without terminating the program, another similar exception will be triggered next when sending an MX query.

@darkoperator darkoperator merged commit 78e8657 into darkoperator:master Nov 16, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants