I'm looking to do something like this in python using dnspython:
dig @XXX.YYY.ZZZ.AAA -p 99 +short '1.1.1.1.1.1.1.1.1.1.1.e164.arpa' naptr
I thought dns.resolver.query would be the way to go, but it seems to choke on the IP address.
My code:
for rdata in dns.resolver.query('XXX.YYY.ZZZ.AAA', 'NAPTR') :
print rdata.target
Output from running the code:
Traceback (most recent call last):
File "...\src\dnslookup.py", line 12, in <module>
for rdata in dns.resolver.query('XXX.YYY.ZZZ.AAA', 'NAPTR') :
File "build\bdist.win-amd64\egg\dns\resolver.py", line 920, in query
File "build\bdist.win-amd64\egg\dns\resolver.py", line 856, in query
dns.resolver.NXDOMAIN