how to resolve name from Python 1.5.*?
Steve Holden
sholden at holdenweb.com
Fri May 4 11:21:22 EDT 2001
"Oleg Broytmann" <phd at phd.fep.ru> wrote in message
news:mailman.988983015.22106.python-list at python.org...
> On Fri, 4 May 2001, Roman Suzi wrote:
> > How do I get a list of IP-address(es) corresponding to a given name
>
> socket.gethostbyname
>
Unfortunately, on my 1.5.2 anyway, gethostbyname returns only one address:
Python 1.5.2 (#1, Mar 7 2000, 14:34:27) [GCC egcs-2.91.66 19990314/Linux
(egcs
- on linux-sparc
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import socket
>>> socket.gethostbyname('www.microsoft.com')
'207.46.230.218'
>>>
[sholden at holden sholden]$ nslookup www.microsoft.com
Server: holden.holdenweb.com
Address: 10.0.0.1
Non-authoritative answer:
Name: www.microsoft.akadns.net
Addresses: 207.46.131.199, 207.46.230.229, 207.46.230.219, 207.46.230.218
207.46.131.91
Aliases: www.microsoft.com
regards
Steve
More information about the Python-list
mailing list