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.

<cfset inet = CreateObject("java", "")>
<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.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 446 other subscribers

© 2011 Anuj Gakhar
%d bloggers like this: