?
Solved

JavaScript for  whois search"?

Posted on 1998-07-16
12
Medium Priority
?
809 Views
Last Modified: 2008-02-01
Is it any java script to search whois DB?
0
Comment
Question by:canmore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266627
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
 
LVL 6

Expert Comment

by:alamo
ID: 1266628
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
 

Author Comment

by:canmore
ID: 1266629
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:alamo
ID: 1266630
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266631
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
 

Author Comment

by:canmore
ID: 1266632
alamo we have nt based server with IIS 4 , And we need this script or ASP code A.S.A.P
0
 
LVL 1

Accepted Solution

by:
davejenkins earned 400 total points
ID: 1266633
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266634
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
 

Author Comment

by:canmore
ID: 1266635
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266636
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266637
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
 
LVL 6

Expert Comment

by:alamo
ID: 1266638
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question