Skip to content

Commit

Permalink
Move the NXDomain catch to look at the results now that we dont raise… (
Browse files Browse the repository at this point in the history
#3997)

Co-authored-by: ammar92 <[email protected]>
  • Loading branch information
underdarknl and ammar92 authored Jan 10, 2025
1 parent 98e81b6 commit a09d6b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boefjes/boefjes/plugins/kat_dns/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def get_parent_zone_soa(resolver: dns.resolver.Resolver, name: Name) -> Answer:
def get_email_security_records(resolver: dns.resolver.Resolver, hostname: str, record_subdomain: str) -> str:
try:
answer = resolver.resolve(f"{record_subdomain}.{hostname}", "TXT", raise_on_no_answer=False)
if answer.rrset is None:
return "NXDOMAIN"
return answer.response.to_text()
except dns.resolver.NoNameservers as error:
# no servers responded happily, we'll check the response from the first
Expand Down

0 comments on commit a09d6b1

Please sign in to comment.