Gilles Ganault <[EMAIL PROTECTED]> wrote:

> I know about socket.gethostbyname, but this relies on what's in
> /etc/hosts, and I'd rather have a more independent solution.

The system I'm currently working on uses exactly this strategy -- we get 
the hostname then do a name lookup on it.  We've gone around and around on 
this, and ended up with that being the best solution.  For us, anyway.  
Your mileage may vary.

As others have pointed out, it's entirely possible to have multiple IP 
addresses.  In addition, your IP address(es) can change as connections come 
up and down, especially in a mobile environment (WiFi, VPN, cellular, etc).  
There is no single correct answer here.

Oh, BTW, did you mean IPv4 or IPv6?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to