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

Allow custom DNS server #29

Open
slavkoja opened this issue Dec 13, 2020 · 4 comments
Open

Allow custom DNS server #29

slavkoja opened this issue Dec 13, 2020 · 4 comments

Comments

@slavkoja
Copy link

Please, add option to use custom DNS server address.

I have split horizon DNS with SMTP server in my local infrastructure, thus i get local IP for A/MX records from system resolver and i cannot use this project to verify public IP with own SPF... Using custom DNS server will allow to bypass this restriction.

@sdgathman
Copy link
Owner

By default, pyspf uses dnspython or py[3]dns. Those packages have options for DNS server. For instance, py3dns calls DNS.Base._DiscoverNameServers() which populates global dictionary Base.defaults with lists at 'domain' and 'server'.
The method is platform dependent (e.g. reading /etc/resolv.conf). So for py(3)dns I would do something like:

import DNS
DNS.Base.defaults['server'] = [ '8.8.8.8', '8.8.4.4' ]

@sdgathman
Copy link
Owner

The hook in pyspf itself is spf.DNSLookup. By default this is set to spf.DNSLookup_dnspython, or if that can't be imported, to spf.DNSLookup_pydns. You could supply your own DNSLookup.

@slavkoja
Copy link
Author

It seems, that i was not clean enough. I mean to add the command line option to spfquery.py script.

@sdgathman
Copy link
Owner

That can be done.

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

2 participants