in reply to IP address to Hostname

It's actually f1.www.vip.re1.yahoo.com. www.yahoo.com is just an alias. gethostbyaddr is what you want.

By the way, Net::DNS is overkill to resolve domains. Socket's inet_aton is sufficient.

Replies are listed 'Best First'.
Re^2: IP address to Hostname
by JavaFan (Canon) on Jul 03, 2009 at 10:22 UTC
    Not only is Net::DNS overkill, but using Net::DNS means you're committed to using DNS to do the domain name resolving. While that may work on many machines, gethostbyaddr will actually use the resolving that's configured for the system. Which, beside DNS, may consist of files, NIS, NIS+, LDAP, ... or some combination of resolving.