I've began building an internet services utility component for doing things like DNS lookup in ColdFusion. It's basically a wrapper to simplify all the JAVA integration calls.
Although I can technically do the following to do a dns lookup from an ip address natively in ColdFusion:
<cfscript>
inetAddress = createObject("java","java.net.InetAddress")
theHost = inetAddress.getByName("209.200.101.202").getHostName();
</cfscript>
The preceding code can take up to 5 seconds if there's no dns record for the given ip address. In most applications that wait is not exactly acceptable! The InetUtils.cfc uses a java jar file from dnsjava.org that speeds up the lookup even when there's no dns record.
Here's a sample code on how to use it, it also returns all dns records found for the ip address as an array, where the previous code only returns one record:
<cfscript>
inetUtils = createObject("component","InetUtils").init();
dnsRecords = arrayNew(1);
dnsRecords = inetUtils.reverseDNS("209.200.101.202");
for(x = 1; x LTE arrayLen(dnsRecords); x = x + 1){
writeOutput(dnsRecords[x]);
}
</cfscript>
I'll be adding new methods like dns lookup and any other methods that fit this library later on. If you have any ideas or requests, I'd be happy to hear it.