Skip to content

Commit bdd9785

Browse files
authored
Merge pull request #113 from cisagov/improvement/add_comment
Explain why NoAnswer/NODATA DOES NOT imply "not live"
2 parents b7f226a + 7877ba0 commit bdd9785

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

trustymail/trustymail.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ def mx_scan(resolver, domain):
9999
domain.mx_records_dnssec = check_dnssec(domain, domain.domain_name, 'MX')
100100
handle_error('[MX]', domain, error)
101101
except (dns.resolver.NoAnswer) as error:
102+
# The NoAnswer exception means that the domain does exist in
103+
# DNS, but it does not have any MX records. It sort of makes
104+
# sense to treat this case as "not live", but @h-m-f-t
105+
# (Cameron Dixon) points out that "a domain not NXDOMAINing
106+
# or SERVFAILing is a reasonable proxy for existence. It's
107+
# functionally "live" if the domain resolves in public DNS,
108+
# and therefore can benefit from DMARC action."
109+
#
110+
# See also https://github.com/cisagov/trustymail/pull/91
111+
102112
# NoAnswer can still have DNSSEC
103113
domain.mx_records_dnssec = check_dnssec(domain, domain.domain_name, 'MX')
104114
handle_error('[MX]', domain, error)

0 commit comments

Comments
 (0)