Navigation | Archive » 2009 » February

February 19, 2009

Coldfusion: DNS Reverse Lookup

I have no idea why this information was so difficult to find, but I'm posting it here in case I ever need it again. To do a reverse lookup in coldfusion: <cfscript> rawIP = createObject("java", "java.net.InetAddress").getByName('#ipaddress#').getAddress(); hostname = createObject("java", "java.net.InetAddress").getByAddress('#rawIP#').getHostName(); chostname = createObject("java", "java.net.InetAddress").getByAddress('#rawIP#').getCanonicalHostName(); </cfscript> Note — this is slow. If you're doing them in [...]

Filed by JC at February 19th, 2009 under ColdFusion
3 persons have commented this post

Distance in CF — Mostly useless, but fun

Assumption: table named locations that has a location name and the location's latitude & longitude as a single field, with lat and lon comma separated, both in signed degrees format. This is an intentional cartesian join… so if you have a lot of locations, use with care. <cfquery datasource="MyDSN" name="getDist"> SELECT DISTINCT        a.latlon AS [...]

Filed by JC at February 19th, 2009 under ColdFusion
No comments on this post yet