Print Page | Close Window

Domain Checker

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=25815
Printed Date: 28 March 2026 at 11:59pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Domain Checker
Posted By: naeemsyed
Subject: Domain Checker
Date Posted: 12 June 2008 at 3:26pm

Hi All

 

I have a signup process which I have done ASP, I wanted to do a domain availability check in during the sign up process, I found a code that pings URL on the internet and adapted it so that it fitted within my code, its below

################################################

 

function isDomainAvailable(strDomainName, strDomainExt)

 

            isDomainAvailable = false

            url = "www." & strDomainName & strDomainExt

 

    Set objWShell = CreateObject("WScript.Shell")

    Set objCmd = objWShell.Exec("ping " & url)

                        strPResult = objCmd.StdOut.Readall()

    set objCmd = nothing: Set objWShell = nothing

 

    if InStr(strPResult,"TTL=") > 0 then

                        errMsg = "'" & url & "' is already taken and not available"

                        isDomainAvailable = true

            else

                        errMsg = "'" & url & "' may still be available"

                        isDomainAvailable = false

            end if

                       

end function

 

#################################################

 

When I run it on my local machine it all works fine, but when I uploaded it to the remote server on GODADDY (IIS 6.0) where I am hosting my site it gives this error
####################

WshShell.Exec error '80070005'

Access is denied.

#####################
 
I have searched on Google and can’t find a way around this, therefore I need help and if someone can advice me
 
1. Can some please tell me how to over this error so that the script starts working?
 



Replies:
Posted By: socialanimal
Date Posted: 12 June 2008 at 4:27pm
The fact that your getting an error denied message means that you can't access wscript on the server which is a security permission that most webhosts don't or won't allow. There is a way around this though, use the XMLHTTP component.

function isDomainAvailable(strDomainName, strDomainExt)

   
isDomainAvailable = False
   
url = "http://www." & strDomainName & strDomainExt

    set objXMLHTTP = server.createobject("Microsoft.XMLHTTP")

    objXMLHTTP.open "GET", url, FALSE

    objXMLHTTP.send NULL

    If objXMLHTTP.status => 200 AND objXMLHTTP.status < 300 Then
       
isDomainAvailable = True
    Else
        isDomainAvailable = False
    End If

    set objXMLHTTP = nothing

End Function

Thats completely off the top of my head but should work fine for your needs. Any problems let me know


Posted By: naeemsyed
Date Posted: 12 June 2008 at 5:01pm
Thanks for the reply, I inserted the above code and got this error
#######################
msxml3.dll error '800c0005'

The system cannot locate the resource specified.

#######################################
 
the error line is pointing to          
 
 objXMLHTTP.send NULL
 
Please advice


Posted By: socialanimal
Date Posted: 12 June 2008 at 5:22pm
Change  objXMLHTTP.send NULL to  objXMLHTTP.send 


Posted By: naeemsyed
Date Posted: 12 June 2008 at 9:00pm
Thank you very much, your advice helped, though it still gave a slight error, but once I changed
 
set objXMLHTTP = server.createobject("Microsoft.XMLHTTP")
to
set objXMLHTTP = server.createobject("MSXML2.ServerXMLHTTP.3.0")
 
It now works fine
 
Regards


Posted By: coolguy345
Date Posted: 18 June 2008 at 5:58am
Hi naeem..this is hassan here.....the project which u have done will help me out for my final year engineering project cos im doing the same project.....i have also tried with ur coding ...but its not working....anyhow im here explaining u how i have a textBox to enter the domain name and i got another one listBox to select the multiple extension like .com,.org,.edu,.net etc and wen the user click the sendButton it should show the reply in the label whether the domain name is available or not.pls help me out.Thanks in advance


Posted By: coolguy345
Date Posted: 18 June 2008 at 5:59am
im doing this project in asp.net using C#


Posted By: naeemsyed
Date Posted: 18 June 2008 at 1:31pm
Hi Coolguy
 
Sorry, the above is done is Classic ASP, I am not much of a C# person
 
Regards


Posted By: coolguy345
Date Posted: 19 June 2008 at 8:06am
anyways thanks for ur reply...if u have any idea abt domain name availability coding..pls let me knw..regards
hassan



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net