0

I have bellow function running on Python 2.7.6 and python 2.7.5

This is 2.7.6

[root@NMCT-MSL-116-1 python_whois-0.2-py2.6.egg-info]# python
Python 2.7.6 (default, Sep 26 2014, 13:25:30)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois as wh
>>> wh.whois('199.96.57.7').emails
['[email protected]', '[email protected]', '[email protected]', '[email protected]',   
'[email protected]', '[email protected]', '[email protected]']

This is 2.7.5

Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois as wh
>>> wh.whois('199.96.57.7').emails
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/whois/__init__.py", line 11, in whois
domain = extract_domain(url)
File "/usr/lib/python2.7/site-packages/whois/__init__.py", line 35, in extract_domain
return socket.gethostbyaddr(url)[0]
socket.herror: [Errno 1] Unknown host

It is same code 2 different Centos versions. First one is 6.5, custom python installation of 2.7.6. Second one is Centos 7 and 2.7.5 default installation. When i manually check both servers can find this host with whois cli tool.

I got stuck and I could not find what is the difference between both machines. They are based on same Network subnet, using same network config except IP addresses.

Does this a difference between versions ? Does anybody has an idea about this ?

3
  • What whois library are you using? Dec 5, 2014 at 14:03
  • python-whois link Dec 5, 2014 at 14:32
  • "unknown host" means a name resolution problem, outside of whois specifics. did you try to do the whois query manually on the second machine? do you have DNS resolution working perfectly there? Jan 2, 2018 at 20:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.