in reply to Retrieving the REMOTE HOST

This behavior is dictated by the CGI specifications.

The CGI environment variable specifications document that the variable REMOTE_HOST does not always get set. Typically this can happen for local requests on ip 127.0.0.1.

You probably want to use REMOTE_ADDR as a more reliable reference. It returns an IP address though.