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

feat: follow mx records back to pointers #16814

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

miketheman
Copy link
Member

@miketheman miketheman commented Sep 30, 2024

In the event that the MX domain returned is not on the list,
but the IP address of the MX server is the same as another one on our
list, resolve those records back to their registered domains to compare.

Signed-off-by: Mike Fiedler miketheman@gmail.com

@miketheman miketheman requested a review from a team as a code owner September 30, 2024 19:33
In the event that the MX domain returned is not on the list,
but the IP address of the MX server is the same as another one on our
list, resolve those records back to their registered domains to compare.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman force-pushed the miketheman/mx-to-ptr-and-back branch from ab96fc8 to c5fa936 Compare October 8, 2024 15:08
# Resolve the returned MX domain's IP address to a PTR record, to a domain
all_mx_domains = set()
for mx_domain in mx_domains:
with contextlib.suppress(dns.resolver.NoAnswer, dns.resolver.NXDOMAIN):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cover slow/broken responses? Do we need to wrap this in some kind of timeout?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading the source of dnspython correctly, when it's initialized it sets a default timeout of 2 seconds. https://github.com/rthalley/dnspython/blob/889385e71021f53e1dc4f117d92aed66bb90d087/dns/resolver.py#L958

@miketheman miketheman merged commit 7194600 into pypi:main Oct 10, 2024
18 checks passed
@miketheman miketheman deleted the miketheman/mx-to-ptr-and-back branch October 10, 2024 14:32
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.

2 participants