Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Domain availability

Status
Not open for further replies.

Dabase

Programmer
Apr 2, 2004
122
PT
Hi,

I have an asp page that looks up domain names to see if they are available for purchase.

I am using Microsoft.XMLHTTP for the purpose (see below some sample code)

Code:
Dim sDomain, sDomainFlag
sDomain = strDomainName & "." &  arrTLDs(1,i)

' Introduce the url you want to visit 
GotothisURL = "[URL unfurl="true"]http://www."[/URL] & sDomain

' Create the xml object 
Set GetConnection = CreateObject("Microsoft.XMLHTTP") 

' Connect to specified URL 
GetConnection.Open "get", GotothisURL, False 
on error resume next 
GetConnection.Send  

' ResponsePage is the response, then print it out to the page 
ResponsePage = GetConnection.getResponseHeader("Date") 

' Write response 
if ResponsePage="" then  
	' Available
	sDomainFlag = "1"
else 
	' Not Available
	sDomainFlag = "2" 
end if

Unfortunately, the above code does not return the correct results, for instance with some domains, it shows has available when in fact it is not available for purchase.

Has anyone experienced similar problems using this method for checking domain availability? Or perhaps a better method could be used.

Any help on this would be much appreciated.

Platform:
OS: Windows 2003 Server - Web Edition
IIS: Version 6.0

Thanks
Dabase
 
Is it really safe to assume that a domain is for sale just because there isn't a server named www answering HTTP Requests on port 80?

Also there is a "server safe" version of the xmlhttp object available.
 
DotNetGnat,

Thanks for the suggestion, what I am actually looking for is to be able to search for various TLD's at one go, much like how you can search on
Any help on this would be much appreciated.

Thanks
Dabase
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top