How to get the ip addresses of a nic

Rob Nikander rnikaREMOVEnder at adelphia.net
Thu Apr 22 00:37:44 EDT 2004


Justin Dubs wrote:
>>>>socket.gethostbyname(socket.gethostname())
> 
> '192.168.0.18'
> 
> Justin Dubs


That always gives me this:

 >>> import socket
 >>> socket.gethostbyname(socket.gethostname())
'127.0.0.1'




More information about the Python-list mailing list