use Socket; $ip = gethostbyname("www.cnn.com"); $string = inet_ntoa($ip); print $string . "\n";