in reply to How to get Remote system hostnames in LAN?

Are you saying you want to transform a pinged IP address into a hostname? If so, use
use Socket; my ($addr) = inet_aton $ip_address_as_string; print scalar gethostbyaddr($addr, AF_INET), "\n";

Replies are listed 'Best First'.
Re^2: How to get Remote system hostnames in LAN?
by asz (Pilgrim) on Jan 25, 2006 at 08:47 UTC
    for gethostbyaddr to work, every IP address in the LAN must have a corresponding entry in the DNS. it is called reverse DNS lookup.

    the host from where your program runs, must know, where to find that information, so first it looks it up locally in a file ( c:\windows\system32\drivers\etc\hosts on Windows XP) and makes a query to a DNS server.

    so, if you are not running a DNS server in your LAN, you must edit your systems hosts file...

    :)))))