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:
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:
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.

Phill Nacelli has been developing software for over 9 years, and have been using ColdFusion since version 4.5. He has engineered and developed multiple web based applications for the federal government, non-profit association/education market and enjoys playing with the latest in programming techniques, frameworks and development tools. He currently holds a position as Software Architect at




Thanks for the heads up, I had originally compressed the files using winRaR format and then renamed the extension to .zip. I have fixed the file an re-uploaded it, give it a shot and let me know if you have any problems..
Cheers..
thanks for this, excellent.. Quick question, can the reverse lookup return more than one record? I was under the impression it would only ever return one record. Which is why I was suprised to see an array returned.
Whahoo, also having some issues submitting this post, the captcha is pretty complicated...
The return data type is an array for cases where there are multiple dns records pointing to the same ip address being queried.
Cheers,
Phill