If you need to know the real host name of your server using php, use the following command:

<? echo gethostbyaddr (gethostbyname ($_SERVER["SERVER_NAME"])); ?>

This will return the server’s hostname, not the address that the script is being accessed by. Very useful if you have a script that needs to run on multiple servers.