Whatever message this page gives is out now! Go check it out!

IsLocalHost

Last update:
May 18, 2026

Description

Determines whether the specified IP address is the localhost. This supports both IPv4 and IPv6 addresses.

Returns

True, if the IP address is the localhost; False, otherwise.

Category

Syntax

IsLocalHost(ipaddress)

See also

History

ColdFusion MX 7.01: Added this function.

Parameters

Parameter
Description
ipaddress
Valid IP address.

Example

<h3>IsLocalHost Example</h3> 

<cfif IsDefined("FORM.theTestIPAddress")> 
<cfif IsLocalHost(FORM.theTestIPAddress)> 
<h3>The IP address <cfoutput>#FORM.theTestIPAddress)#</cfoutput> is the localhost</h3> 
<cfelse> 
<h3>The IP address <cfoutput>#DE(FORM.theTestIPAddress)#</cfoutput> is not the localhost.</h3> 
</cfif> 
</cfif> 

<form action = "isIPAddressLocalHost.cfm"> 
<p>Enter an IP address to find out if it is the localhost. 
<p><input type = "Text" name = "TheTestIPAddress" value = "127.0.0.1" 
<input type = "Submit" value = "Is this the localhost?" name = ""> 
</form>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page