#702 whois server connect failure

open
nobody
5
2012-12-31
2011-01-19
Anonymous
No

The hardcoded whois server for most domains returns a cannot connect error from my network.
I changed the whois server listed on line 85 'rs.internic.net' to the one being queried when i run the command from the system 'whois.verisign-grs.com'

I'm fairly sure this is a situation where some will work some and others will need something different. Maybe it can be made to be a setting that can be changed in the bot whenever necessary?

Discussion

  • Dennis de Vaal
    Dennis de Vaal
    2011-12-17

    The whois method of the Internet plugin uses rs.internic.net whois server (through telnet) to lookup domain information for com, net and edu domains, otherwise it uses a country code specific whois server, e.g. nl.whois-servers.net. As a last resort it tries to use pir.org, which sometimes results in Error: I couldn't find such a domain. Which can be misleading because whois.pir.org is also used when a particular whois server didn't return any parsable results.

    Because rs.internic.net doesn't exist anymore socket.error is raised and catched on lines 92-94, The messages: '[Errno 111] Connection refused' or '[Errno 113] No route to host' from the exception object is returned and shown on irc.

    This whois method is way too big and kind of messy for my taste (I realize it's pretty old). It's also not very fault tolerant. Try for example domain.n, which returns Error: [Errno -2] Name or service not known, obviously because n.whois-servers.net doesn't exist (it shouldn't even perform a lookup at this point, since the whois server address is wrong).

    It shouldn't be necessary to pass your own whois server to this command. The correct whois server should be automatically picked.

    Quick fix:

    Change server = 'rs.internic.net' on line 85 to server = 'whois.internic.net' This solves the problem and allows lookups for com, net, edu domains again.

    A better fix:

    I wrote a new plugin called Domain which implements better whois functionality by using pywhois (http://code.google.com/p/pywhois/). It's still very basic but it does the job, supports more domains and is also more fault tolerant. You can find it here: https://github.com/ddevaal/supybot-plugins