Solved

JavaScript for  whois search"?

Posted on 1998-07-16
12
594 Views
Last Modified: 2008-02-01
Is it any java script to search whois DB?
0
Comment
Question by:canmore
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 6

Expert Comment

by:alamo
Comment Utility
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
Comment Utility
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
Comment Utility
alamo we have nt based server with IIS 4 , And we need this script or ASP code A.S.A.P
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 1

Accepted Solution

by:
davejenkins earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now