use Socket; my ($addr) = inet_aton $ip_address_as_string; print scalar gethostbyaddr($addr, AF_INET), "\n";