use Socket; $packed_ip = gethostbyname("www.perl.org"); if (defined $packed_ip) { $ip_address = inet_ntoa($packed_ip); }