diff -r 16f17c400a70 -r f3c0a9a442aa whois/__init__.py --- a/whois/__init__.py Wed Mar 05 15:41:49 2014 -0500 +++ b/whois/__init__.py Fri Mar 21 12:09:00 2014 -0400 @@ -8,7 +8,11 @@ def whois(url): # clean domain to expose netloc - domain = extract_domain(url) + ip_match = re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", url) + if ip_match: + domain = url + else: + domain = extract_domain(url) try: # try native whois command first r = subprocess.Popen(['whois', domain], stdout=subprocess.PIPE)