Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent timeouts using pythonwhois #124

Open
hserus1477 opened this issue Jun 8, 2016 · 2 comments
Open

Frequent timeouts using pythonwhois #124

hserus1477 opened this issue Jun 8, 2016 · 2 comments

Comments

@hserus1477
Copy link

Hi - I (repeatably, as of the past few minutes) get timeouts even querying popular domain names like say icloud.com - and when I execute the same command from my command line whois client, I get the whois instantaneously. Thanks for a fix - maybe you could also call the command line whois tool here (https://github.com/rfc1036/whois) and parse its output? Thanks.

domain = ('icloud.com')
:> details=pythonwhois.get_whois(domain)

Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.7/site-packages/pythonwhois/init.py", line 4, in get_whois
raw_data, server_list = net.get_whois_raw(domain, with_server_list=True)
File "/Library/Python/2.7/site-packages/pythonwhois/net.py", line 69, in get_whois_raw
return get_whois_raw(domain, referal_server, new_list, server_list=server_list, with_server_list=with_server_list)
File "/Library/Python/2.7/site-packages/pythonwhois/net.py", line 69, in get_whois_raw
return get_whois_raw(domain, referal_server, new_list, server_list=server_list, with_server_list=with_server_list)
File "/Library/Python/2.7/site-packages/pythonwhois/net.py", line 44, in get_whois_raw
response = whois_request(request_domain, target_server)
File "/Library/Python/2.7/site-packages/pythonwhois/net.py", line 86, in whois_request
sock.connect((server, port))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 60] Operation timed out

@Sir-Fenrir
Copy link

This is because the WHOIS response for icloud.com contains a referral link to an inactive server. It tries to obtain data from this inactive server, which obviously does not respond.
On my develop branch https://github.com/MasterFenrir/python-whois/tree/develop this issue is fixed. It checks whether a referral server is alive or not before querying it.

@cristianocca
Copy link

Hello, is this issue already part of the current version? I'm wondering if there's a way to also define some kind of timeout, the default one seems too high for some use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants