|
Query a whois server
COM component to query a WHOIS server and retrieve
information in plain text or HTML format . We are using the
free component from components2go . You can download this component
here.
Install the component and enter the following .
Code :
<%
'variable declaration
Dim objWhois
'create an instance of whois object
Set objWhois = Server.CreateObject("c2g.whois")
'set the server , this is better than the default
objWhois.Server = "whois.networksolutions.com"
'whois port is 43
objWhois.Port = 43
'set timeout for 20 seconds default is 5
objWhois.Timeout = 20
'store the whois query of yahoo in strResult
strResult= objWhois.whois("yahoo.com")
'if there is an error display it
if err.number<>0 then
Response.Write"Error: " & err.Description
'or display the results of the query
else
Response.Write strResult
end if
'destroy the object
Set objWhois = Nothing
%>
Notes :
We have set a different Server and Timeout values
than use the default as the default server was displaying comments
about certain companies such as Microsoft and Yahoo and did
not look professional enough to us . We also increased the Timeout
value from 5 to 20 seconds
|