OT: converting to IP address

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Buettner
Date:  
Subject: OT: converting to IP address
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