Using gethostbyaddr() to get a host name
if ( ! empty( $_SERVER['REMOTE_HOST'] ) ) {
print "Hello visitor at ".$_SERVER['REMOTE_HOST'];
} else if ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
print "Hello visitor at ";
print gethostbyaddr( $_SERVER['REMOTE_ADDR'] );
} else {
print "Hello you, wherever you are";
}
?>