ResolveIP Method

 

BrowserHawk provides the ResolveIP method for performing reverse DNS look-ups on visitors hitting your web site. By default, the ResolveIP method performs the lookup on the value in the IPAddr property of the BrowserHawk object, which is set automatically to the IP address of the visitor when using the object under ASP.

 

You can also perform reverse DNS look ups on any other IP address you wish, simply by passing in the IP address as a parameter to the ResolveIP method. Note: Since the IPAddr field is only set when using the BrowserHawk ActiveX component under ASP, ColdFusion users must pass in the IP address that they wish to look up.

 

Syntax:

string bhObject.ResolveIP [ipAddr]

 

Object: an instance of the BrowserHawk ActiveX component created with the "Server.CreateObject" statement

ipAddr: optional. If present, BrowserHawk will return the host name for the IP address specified. If not present, the IP address for the current visitor is returned.

Note: BrowserHawk uses your local winsock library to look up the host name based on your DNS settings. If the host name is not available, an empty string is returned.

 

Example:

<% set thisBrow = Server.CreateObject("cyScape.browserObj")

hostname = thisBrow.ResolveIP

if hostname <> "" then

 response.write "your host name is: " & hostname

else

 response.write "host name not available"

end if %>

 

Note: For ColdFusion users the ipAddr parameter is not optional.

 

Note: Reverse DNS look-ups are be a time consuming operation, typically taking 1-3 seconds or possibly longer, particularly when the host name cannot be found.

 

See Also:

IPAddr Property