ColdFusion Muse

Ask A Muse: Looking Up and IP Address By Host Name

Mark Kruger February 18, 2007 12:33 PM Coldfusion Tips and Techniques Comments (1)

Muse Reader Asks:
I need to resolve an internet address. For example, if I have www.someintenetsite.com, I'd like to be able to return the IP address.

One of the nice things about Coldfusion is the easy access to all that lovely Java stuff under the hood. Check out this network function listed at cflib.org. the basic syntax is:

<cfscript>
    MyIp = getHostAddress(someurl);
</cfscript>
That's it. Good luck and happy coding.

  • Share:

1 Comments

  • Ben Forta's Gravatar
    Posted By
    Ben Forta | 2/21/07 3:57 PM
    Darn, I wrote that UDF years ago, forgot all about it! :-)

    --- Ben