home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 37 / IOPROG_37.ISO / SOFT / EXISTDNS.ZIP / Asp / DnsQuery.asp
Encoding:
Text File  |  1999-07-27  |  5.5 KB  |  137 lines

  1. <%
  2.     ' This file is provided as part of  ASP Power Widgets Samples
  3.     '
  4.     ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
  5.     ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  6.     ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
  7.     ' OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
  8.     ' PURPOSE.
  9.  
  10.     ' Copyright 1997-1998. All rights reserved.
  11.     ' Dalun Software Inc. ASP Power Widgets
  12.     ' http://www.dalun.com/register.html
  13.     ' email: techsupport@dalun.com
  14.     ' Revision History: 
  15.     '       1.1.1  ASP changes. May 14,99
  16.     '       1.1.2  Added RegistrationCode property. June 15,99          
  17.     '              Added Timeout Property.
  18.     '       1.1.3  Modified for Internic changes. July 27,99
  19.     ' Note: Requires MSWinsck.ocx.
  20.     '       You have 30 days to evaluate the component. 
  21. %>   
  22.  
  23. <% Response.Buffer = True%>
  24. <HTML>
  25. <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
  26. <BODY bgColor=#ffcc00 link=#006699 text=#000000 vLink=#666633>
  27.  
  28.  
  29. <TABLE bgColor=#ffcc00 border=0 cellPadding=0 cellSpacing=0 width=427>
  30. <TBODY>
  31.     <TR>
  32.         <TD colSpan=3 width=344>
  33.         <IMG height=23 src="images/register_a_web_address.gif" 
  34.                 width=344>
  35.     </TD>
  36.         <TD rowSpan=4 width=73><A 
  37.             href="http://www.networksolutions.com/purchase/index.html">
  38.     <IMG 
  39.             alt="Seach for a domain name" border=0 height=48 hspace=0 
  40.             src="images/search_for_it.gif" vspace=23 
  41.             width=73></A>
  42.     </TD>
  43.     <TD rowSpan=5 width=10>
  44.     </TD></TR>
  45.         
  46. <FORM action=DnsQuery.asp method=post id=form1 name=form1>
  47.         <TR>
  48.           <TD colSpan=2 noWrap vAlign=center><FONT 
  49.             face="Arial, Helvetica, sans-serif" size=2>www.</FONT>
  50.             <INPUT maxLength=26 name=STRING size=22 value="<%=Request("String")%>">
  51.             <SELECT name=TLD size=1>
  52.               <OPTION <%If Request("TLD")="" then%>selected<%End if%><%If Request("TLD")=".com" then%>selected<%End if%>  value=.com>.com</OPTION>
  53.               <OPTION <%If Request("TLD")=".net" then%>selected<%End if%> value=.net>.net</OPTION> 
  54.               <OPTION <%If Request("TLD")=".org" then%>selected<%End if%> value=.org>.org</OPTION>
  55.               <OPTION <%If Request("TLD")=".edu" then%>selected<%End if%> value=.edu>.edu</OPTION>
  56.             </SELECT>
  57.           </TD>
  58.           <TD noWrap vAlign=center>
  59.            <INPUT border=0 height=21 name=Submit 
  60.             src="images/go.gif" type=image value=SUBMIT 
  61.             width=29> </TD>
  62.          </TR>
  63.  </FORM>
  64.  
  65.         <TR>
  66.           <TD noWrap vAlign=center><FONT 
  67.             face="Arial, Helvetica, sans-serif" size=1><B>1.</B>enter a name, word or 
  68.             phrase</FONT></TD>
  69.           <TD noWrap vAlign=center><FONT 
  70.             face="Arial, Helvetica, sans-serif" size=1><B>2.</B>choose a domain</FONT></TD>
  71.           <TD noWrap vAlign=center><FONT 
  72.             face="Arial, Helvetica, sans-serif" size=1><B>3.</B>click GO!</FONT>
  73.         </TD></TR>
  74.         <TR>
  75.           <TD colSpan=3 noWrap><FONT color=#333333 
  76.             face="Arial, Helvetica, sans-serif" size=1>Search for a Web Address 
  77.             (domain name) with no obligation!</FONT></TD></TR>
  78.         <TR></TR></TBODY></TABLE>
  79.   
  80. <% 
  81.     Dim sDn, sResp
  82.     
  83.     if Trim(Request("String")) <>"" Then
  84.         Server.ScriptTimeOut = 150 
  85.         sDn=Trim(Request("String")) & Request("TLD")
  86.         Set oDnsQuery = CreateObject("ASPPW.WhoisQuery")
  87.  
  88.         'oDnsQuery.RegistrationCode=""                  'String expression. You may put your reg code here, if you don't want to use the RegTool.exe
  89.  
  90.         'oDnsQuery.WhoisServer="rs.internic.net"        'You don't have to specify rs.internic.net, the default value.
  91.         'oDnsQuery.WhoisServerPort = 43         
  92.  
  93.         oDnsQuery.Timeout = 120                         '120 Seconds.
  94.  
  95.         if oDnsQuery.SendQuery(sDn) = true then
  96.             sResp=oDnsQuery.GetResponse                 'Please refer to the sample below
  97.             Response.write "<pre>"
  98.             Response.write sResp
  99.             Response.write " </pre><br>"
  100.         
  101.             if oDnsQuery.IsRecordFound = false then 
  102.                 response.write "No match for this query."
  103.             end if
  104.             
  105.             'Sample for Domain name query
  106.             If Request("DispFields") <> "" Then
  107.                 response.write "<pre>Registrant: " + oDnsQuery.GetRegistrant + "</pre><br>"
  108.                 response.write "<pre>DomainName: " + oDnsQuery.GetDomainName + "</pre><br>"
  109.                 response.write "<pre>AdministrativeEmail: " + oDnsQuery.GetAdministrativeEmail + "</pre><br>"
  110.                 response.write "<pre>TechnicalEmail: " + oDnsQuery.GetTechnicalEmail + "</pre><br>"
  111.                 response.write "<pre>ZoneEmail: " + oDnsQuery.GetZoneEmail + "</pre><br>"
  112.                 response.write "<pre>billingEmail: " + oDnsQuery.GetbillingEmail + "</pre><br>"
  113.                 response.write "<pre>RecordLastUpdateTime: " + oDnsQuery.GetRecordLastUpdateTime + "</pre><br>"
  114.                 response.write "<pre>RecordCreateTime: " + oDnsQuery.GetRecordCreateTime + "</pre><br>"
  115.                 response.write "<pre>DatabaseLastUpdateTime: " + oDnsQuery.GetDatabaseLastUpdateTime + "</pre><br>"
  116.                 response.write "<pre>DomainServers: " + oDnsQuery.GetDomainServers + "</pre><br>"
  117.                 response.write "<pre>AdministrativeContact: " + oDnsQuery.GetAdministrativeContact + "</pre><br>"
  118.                 response.write "<pre>TechnicalContact: " + oDnsQuery.GetTechnicalContact + "</pre><br>"
  119.                 response.write "<pre>ZoneContact: " + oDnsQuery.GetZoneContact + "</pre><br>"
  120.                 response.write "<pre>BillingContact: " + oDnsQuery.GetBillingContact + "</pre><br>"
  121.         
  122.                 response.write "If you are quering an ip address:<br>"
  123.                 response.write  "<pre>HostName: " + oDnsQuery.getHostName  + "</pre><br>"
  124.                 response.write  "<pre>Coordinator: " + oDnsQuery.GetCoordinator  + "</pre><br>" 
  125.             End if
  126.     else 
  127.         response.write oDnsQuery.GetLastErrDescription
  128.     end if
  129.     
  130.     Set oDnsQuery = Nothing
  131. End if
  132.  
  133. %>    
  134. <p align="right"><a href="http://www.dalun.com"><font face="Verdana, Arial" size="1">Dalun Software, Inc. </font></a>
  135.  
  136. </BODY></HTML>
  137.