whois like functionality on Windows?

Thomas Heller theller at python.net
Tue Jun 28 11:06:37 EDT 2005


Gerrit Muller <gerrit.muller at embeddedsystems.nl> writes:

> I am migrating a website from a UNIX based machine to an Windows
> machine. In the logfiles I got from the old machine I mostly got
> domain names and sometimes only IP addresses. The Windows machine
> seems to produce only IP addresses.
>
> Somehow I cannot find a windows solution to translate an IP address
> back into a domain-name. Searching with Google shows that more people
> have been wrestling with this problem.
>
> I did find working whois scripts, but unfortunately:
> - the verbose whois registrar information often forbids automated access
> - the information is rather distributed, so you have to somehow access
> sufficient servers
> - you still have to find the domain name in the sea of details returned
>
> I also found socket based solutions, but these solutions crash with
> the message "host not found" :-(
>
> Anyone suggestions?

This?

C:\>py23
Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostbyaddr("194.109.137.226")
('fang.python.org', [], ['194.109.137.226'])
>>>

Thomas



More information about the Python-list mailing list