Hey there, I am trying to find a coldfusion method to convert an IP address to a hostname. I used to be using the following: <cfset inet_address = CreateObject("java", "java.net.InetAddress")> <cfset myHostName = inet_address.getByName(cgi.REMOTE_ADDR).getHostName()> However, my hosting company recently disabled CreateObject. Any suggestions are welcome. Sincerely, Travis Walters
Hey there, I found a solution. The only bad part is that the solution is not completely coldfusion. <cfhttp method="Get" url="http://www.#myDomain#/getHostname.php?ipAddress=#cgi.REMOTE_ADDR#" resolveurl="Yes"> <cfset myHostName = '#Trim(cfhttp.FileContent)#'> It appears PHP is also enabled on my server. So I was able to create this PHP file from coldfusion: <?php $hostname = gethostbyaddr($_GET['ipAddress']); echo $hostname; ?> I was just wondering, how come the closing tag </cfhttp> is not needed for the GET variable? Sincerely, Travis Walters