Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import DNS
>>> DNS.revlookup('96.51.148.193')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/DNS/lazy.py", line 20, in revlookup
return Base.DnsRequest(b, qtype = 'ptr').req().answers[0]['data']
IndexError: list index out of range
Patch to return the DNS status instead attached.
Better patch
Fixed in py3dns 3.0.0. Still open for python2.
An exception for the status error is good. If there is no PTR, however, this should return None. Also, revlookup should call revlookupall() and return the shortest (first?) name.
Concept incorporated in pydns-2.3.5