OT: converting to IP address

Kevin Buettner plug-discuss@lists.plug.phoenix.az.us
Sun, 9 Mar 2003 03:37:10 -0700


On Mar 8, 10:18pm, Cliff Rogers wrote:

> I know this is not a *nix question but I think I saw this on the
> list sometime ago.  Is there a way to convert "members.cox.net" to
> an IP address like XXX.XXX.XXX.XXX?

perl -e 'print join(".", unpack('C4', (gethostbyname("members.cox.net"))[4])), "\n"'

(However, it's probably easier to use either dig or nslookup.)

Kevin