yolothreat / utilitybelt

A Python library for being a CND Batman....
MIT License
35 stars 12 forks source link

reverse_dns function needs error checking #63

Open deadbits opened 8 years ago

deadbits commented 8 years ago

reverse_dns will throw herror "Unknown host" exceptions on IP addresses that don't have a PTR record.

>>> import utilitybelt as ub
>>> ub.reverse_dns('1.54.140.138')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "<input>", line 3, in reverse_dns
herror: [Errno 1] Unknown host
>>> print "why python gods why!"
why python gods why!
sroberts commented 8 years ago

Yeah, that's probably a fairly good point.

deadbits commented 8 years ago

I can make a PR to patch this later today. Just wanted to have the issue in for reference when I do :)

krmaxwell commented 8 years ago

:+1: