Solved

JavaScript for  whois search"?

Posted on 1998-07-16
12
620 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
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Accepted Solution

by:
davejenkins earned 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

910 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

16 Experts available now in Live!

Get 1:1 Help Now