use Socket; my $ip = '127.0.0.1'; my $name = gethostbyaddr(inet_aton($ip), AF_INET ); print $name ? $name : "NOT FOUND";