use Socket; $IP = inet_aton ('127.0.0.1'); $HOST = gethostbyaddr($IP, AF_INET); print $HOST;