GetHostName(address)
Last updated December 19, 2001
Version: 1 | Requires: ColdFusion 5 | Library: NetLib
Description:
DNS lookup, provide an IP address, it'll return a host name. If the address is invalid an exception will be throw, so <CFTRY>/<CFCATCH> should be used.
Return Values:
Returns a domain name.
Example:
#GetHostName(CGI.REMOTE_ADDR)#<br>
<i>Note, since we cache pages, the result of this test will not reflect your remote address.</i>
</CFOUTPUT>
Parameters:
| Name | Description | Required |
|---|---|---|
| address | IP address to look up. | Yes |
Full UDF Source:
<cfscript>
/**
* Performs a DNS lookup on an IP address.
*
* @param address IP address to look up.
* @return Returns a domain name.
* @author Ben Forta (ben@forta.com)
* @version 1, December 19, 2001
*/
function GetHostName(address) {
// Variables
var iaclass="";
var addr="";
// Init class
iaclass=CreateObject("java", "java.net.InetAddress");
// Get address
addr=iaclass.getByName(address);
// Return the name
return addr.getHostName();
}
</cfscript>
Search CFLib.org
Latest Additions
Jose Diaz-Salcedo added
cfRssFeed
2 day(s) ago
Raymond Compton added
structBlend
23 day(s) ago
Duncan added
IsZIPUK
23 day(s) ago
Todd Sharp added
getTagContentAll
29 day(s) ago
Gerald Guido added
ListReturnDuplicat...
1 month(s) ago