danielhordern.com

HostCom - a very simple ASP ActiveX component that currently only has a single function - to look up a host name from an IP address.   Download HostComponents.zip    To install, unzip the file, and register the dll (regsvr32 hostcomponents.dll)

Properties

  • None

Members

  • HostName([in] BSTR Name, [out, retval] BSTR *Translated)

 

Output from sample script

Your IP address:38.107.191.89
Your Host Name:error

Sample script

// HostCom test function
function HostCom_Test1()
{
   try
   {
      var oHostCom = Server.CreateObject('HostComponents.HostCom');
      var ipAddr = Request.ServerVariables("REMOTE_ADDR");
      
      Response.Write('Your IP address:' + ipAddr + '<br>');
      Response.Write('Your Host Name:' + oHostCom.HostName( ipAddr ) );
   }
   catch( e )
   {
      Response.Write('exception: ' + e.description + '<br>');
   }
}

Test Form