Link to home
Start Free TrialLog in
Avatar of canmore
canmore

asked on

JavaScript for whois search"?

Is it any java script to search whois DB?
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

What is a WHOIS db?

Any client based javascript will only be able to seach a javascript based database which has to be inside a page on the client so it would be restricted to a few hundred entries...

Please give more detail

Michel
Avatar of alamo
alamo

Michel, look at http://rs.internic.net/cgi-bin/whois and you'll understand what a whois database is, whois is a Unix command-line utility which queries a directory of the net, basically. I believe it's possible to set up a local server to allow whois on the local users.

Javascript can't by itself search a whois DB because it can't connect to an external server. You might be able to do it with Java if you have a whois server running on the same machine as your web server. Another approach would be to have a CGI which does the query and returns the results. You could also put a web interface to a whois server into a frame, for example the link I gave before.

canmore, perhaps if you have us a better idea of what you want to accomplish we can recommend the best course of action.
Avatar of canmore

ASKER

We would like to search domain name if it's availeble and we do not need build DB on the page. We would like have only 1 answer yes/no.
Sounds like you want something like http://tabnet.com/yahoo/ or even https://register.mindspring.com/cgi-bin/wsisa.dll/webhost/signup/step1.html (I just picked two at random).

It sounds then like you want to put a CGI on your server, that's the most common way to do it. (You could also do it with an ASP page or server side include etc, but the point is you can't do it completely from the client, you need some server support).

What server-side options do you have? What kind of web server?
Alamo: I knew that some servers are set up to handle whois requests - I just didn't connect it to something that could be handled with JavaScript...

SSI,  CGI or other serverbased program can of course return anything the webserver is allowed to see/execute and JavaScript could be used to poll the server.

If however the WHOIS command is available to the client, JavaScript could be used to create that command and execute it with the normal browser security restraints

Michel

Avatar of canmore

ASKER

alamo we have nt based server with IIS 4 , And we need this script or ASP code A.S.A.P
ASKER CERTIFIED SOLUTION
Avatar of davejenkins
davejenkins

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dave: Cute, but can you use the result in your own page without violating cross domain security?

The url can still be used, but then using a socket call to internic from a cgi or Java

Michel
Avatar of canmore

ASKER

Thank you guys for help. Java Script from the davejenkins does not work. It will generated Error in the line #4, argument is not valid. Sound's to me I can not get answer for my questions.
Well I have ASP Script to do WHOIS search and I can give it for you for your future ref., but you need ACI.DLL file for this script and form file in the .ASP format.
Please close my account.
------------------------------------------

<%
' If user entered a Domain Name (second time through this form)
If request.form("DomainName") <> "" then
      
      ' If user clicked on Reset button
      If Request.Form("Action") = "Reset" then
            Session("DomainName") = ""
            Session("Results") = ""      

      ' Else if the user clicked on the Submit buttom
      ElseIf Request.Form("Action") = "Submit" then      

            ' Store what the user entered
            Session("DomainName") = request.form("DomainName")

            ' Setup ASP Error handler
            On Error Resume Next

            ' Create the "ACIWhoIs" object
            Set oACI = Server.CreateObject("ACI.WhoIs")        

            ' If we were able to create the object
            If IsObject( oACI ) then

                  ' Setup calling parameters
                  HostName = "whois.internic.net"
                  Query = request.form("DomainName") & vbLfCr

                  ' Make the WhoIs call
                  Session("Results") = oACI.WhoIs( CStr(HostName), CStr(Query), CInt(30) )

                  If Err.Number > 0 then
                         Session("Results") = "Error: " & Err.Number & " - " & Err.Description
                  End If
            Else
                   Session("Results") = "Error: " & Err.Number & " - " & Err.Description
            End If

            Set oACI = Nothing
      End If
End If
%>
----------------------------------------
The error message could be due to the space in the window name.

Try
window.open(whoisstring, "WhoisWindow","toolbar=yes, location=yes,status=yes,height=500,width=600");

instead.

My comment still stands, however.

Michel
The error message could be due to the space in the window name.

Try
window.open(whoisstring, "WhoisWindow","toolbar=yes, location=yes,status=yes,height=500,width=600");

instead.

My comment still stands, however.

Michel
canmore, you should reject the current answer and post a question in customer service asking them to to delete this question since you found the answer on your own.