This was created because "REMOTE_HOST" environment variable does not always work.

Using Php

Your IP is : 54.167.44.32

Your Hostname is: ec2-54-167-44-32.compute-1.amazonaws.com

REMOTE_HOST =


Use the following php code to generate this:

$ip = getenv('REMOTE_ADDR');
$host = gethostbyaddr($ip);

Using Perl

Demo

Code