1
I have a problem with a script where I need to use the dns package in Python.
import dns.resolver
And to perform a simple DNS check:
my_resolver = dns.resolver.Resolver()
my_resolver.nameservers = ['8.8.8.8']
records = my_resolver.query(domain, 'MX')
I already installed the package, and I continue with the following error:
records = my_resolver.query(domain, 'MX')
File "build/bdist.linux-x86_64/egg/dns/resolver.py", line 1036, in query
File "build/bdist.linux-x86_64/egg/dns/resolver.py", line 233, in __init__
dns.resolver.NoAnswer: The DNS response does not contain an answer to the question: uol.com.br. IN MX
Any hint?