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

Using Php

Your IP is : 54.92.197.82

Your Hostname is: ec2-54-92-197-82.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