DNS lookup
Siggy Brentrup
bsb at winnegan.de
Thu Dec 16 11:16:42 EST 1999
Michael Spalinski <mspal at sangria.harvard.edu> writes:
> Is there a module which would let me do something like
>
> nslookup('132.151.1.90')
>
> and get the string 'parrot.python.org'?
Just happened to do this some minutes ago:
Python 1.5.2+ (#4, Nov 18 1999, 01:39:08) [GCC egcs-2.91.66 19990314 (egcs-1.1.2 release)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
IDLE 0.5 -- press F1 for help
>>> import socket
>>> socket.gethostbyaddr('132.151.1.90')
('parrot.python.org', [], ['132.151.1.90'])
>>> host, aliases, ips = socket.gethostbyaddr('132.151.1.90')
>>> print host
parrot.python.org
>>>
not-quite-Cato-ly-yoUr's
Siggy
--
Siggy Brentrup - bsb at winnegan.de - http://www.winnegan.de/
****** ceterum censeo javascriptum esse restrictam *******
More information about the Python-list
mailing list