JavaScript for whois search"?

Is it any java script to search whois DB?
canmoreAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
davejenkinsConnect With a Mentor Commented:
Canmore,

YES, it is possible:

<script>
var lookup

function getWhois(lookup)
{
var whoisstring = "http://www.internic.net/cgi-bin/whois?"+lookup;
window.open(whoisstring, "Whois Window","toolbar=yes, location=yes,status=yes,height=500,width=600");
}
</script>

Then put some box down in your page somewhere like
<input type=text name="lookup" onBlur="getWhois(this)" size=20>

That should do it. (I wrote this off the cuff.  You're gonna have to insert it into a page and try it out)
0
 
Michel PlungjanIT ExpertCommented:
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
0
 
alamoCommented:
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.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
canmoreAuthor Commented:
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.
0
 
alamoCommented:
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?
0
 
Michel PlungjanIT ExpertCommented:
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

0
 
canmoreAuthor Commented:
alamo we have nt based server with IIS 4 , And we need this script or ASP code A.S.A.P
0
 
Michel PlungjanIT ExpertCommented:
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
0
 
canmoreAuthor Commented:
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
%>
----------------------------------------
0
 
Michel PlungjanIT ExpertCommented:
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
0
 
Michel PlungjanIT ExpertCommented:
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
0
 
alamoCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.