diff -r 0b098688af21 -r d6fcfa5acc7b whois/__init__.py --- a/whois/__init__.py Thu Jun 02 13:37:33 2016 -0700 +++ b/whois/__init__.py Thu Jun 02 13:56:11 2016 -0700 @@ -19,6 +19,12 @@ ip_match = re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", url) if ip_match: domain = url + try: + result = socket.gethostbyaddr(url) + except socket.herror as e: + pass + else: + domain = result[0] else: domain = extract_domain(url) if command: