$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); if($hostname === $_SERVER['REMOTE_ADDR']) { echo "The host name could not be resolved.\n"; } else { echo "The host name is: $hostname\n"; }?>