getHostName

On October 22, 2007, in ColdFusion, by Anuj Gakhar

Just came across this rather interesting way to get the current hostname programmatically. Thought it might be useful to post here.

[xml]
<cfset inet = CreateObject("java", "java.net.InetAddress")>
<cfdump var = "#inet.getLocalhost().gethostname()#">[/xml]

Tagged with:  

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2011 Anuj Gakhar
%d bloggers like this: