From: Mike Stok Date: 2002-05-16T01:19:43+09:00 Subject: Re: Retrieving External IP In article , Mike Stok wrote: > In article , Seth Harper wrote: >> I'm attempting to write a small script that retrieves a servers >> external IP adress, but I keep comming up with it's subnet IP, any >> suggestion on how to grab the external IP? Thank you much :) >> >> Here's the Code for returning the the IP from the hostname: >> >> host = Socket.gethostname >> IP = IPSocket.getaddress(host) > > Do you know the name of the external interface? It may be different from > what's returned by hostname. Ignore me, plugging the right hostname into IPSocket.getaddress(host) works and does all that conversion behind the scenes :-( Mike -- mike@stok.co.uk | The "`Stok' disclaimers" apply. http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA mike@exegenix.com | Fingerprint 0570 71CD 6790 7C28 3D60 http://www.exegenix.com/ | 75D2 9EC4 C1C0 0599 13DA