Developer's Manual for ASPPW DnsQuery Component
Version | : | 1.1 |
Status | : | Draft |
DnsQuery Component can send your query to interNic Whois server and return you the response. Moreover, it will try to parse the response and let you get specific fields such as administrative email, etc. You can use this component to check if a domain name such as what.com has been taken or not. DnsQuery Component is especially useful for those Virtual Domain hosts.
For this version, it can only parse the response from rs.interNic.net Whois server and the parse is restricted to queries for a single domain name or IP address. If necessary, we can change the parsing algorithm according to your special requirement.
DnsQuery Component requires the port 43 and it can't work if this port has been blocked by a firewall.
Public Property Let WhoisServer(strSvr As String) Public Property Get GetResponse() As String Public Property Get IsRecordFound() As Boolean
'For Domain Name Query Public Property Get GetRegistrant() As String Public Property Get GetDomainName() As String Public Property Get GetAdministrativeEmail() As String Public Property Get GetTechnicalEmail() As String Public Property Get GetZoneEmail() As String Public Property Get GetbillingEmail() As String Public Property Get GetRecordLastUpdateTime() As String Public Property Get GetRecordCreateTime() As String Public Property Get GetDatabaseLastUpdateTime() As String Public Property Get GetDomainServers() As String Public Property Get GetAdministrativeContact() As String Public Property Get GetTechnicalContact() As String Public Property Get GetZoneContact() As String Public Property Get GetBillingContact() As String
'For IP query Public Property Get getHostName() As String Public Property Get GetCoordinator() As String
'Error handling Public Property Get GetLastErrNum() As Long Public Property Get GetLastErrSource() As String Public Property Get GetLastErrDescription() As String
Methods:
Public Function SendQuery(strQuery As String) As Boolean
Usage:
1. Create the object. Set oDnsQuery = Server.CreateObject("ASPPW.WhoisQuery")
2. Set the Whois server oDnsQuery.WhoisServer="rs.internic.net"
'Note: Default is rs.internic.net, if you don't set this property. Thus This step can be skipped.
3. Send your query
if oDnsQuery.SendQuery("mit.edu") = true then sResp=oDnsQuery.GetResponse 'Please refer to below sample if oDnsQuery.IsRecordFound = false then response.write "No match for this query." response.end end if 'Sample for Domain name query response.write oDnsQuery.GetRegistrant response.write oDnsQuery.GetDomainName response.write oDnsQuery.GetAdministrativeEmail response.write oDnsQuery.GetTechnicalEmail response.write oDnsQuery.GetZoneEmail response.write oDnsQuery.GetbillingEmail response.write oDnsQuery.GetRecordLastUpdateTime response.write oDnsQuery.GetRecordCreateTime response.write oDnsQuery.GetDatabaseLastUpdateTime response.write oDnsQuery.GetDomainServers response.write oDnsQuery.GetAdministrativeContact response.write oDnsQuery.GetTechnicalContact response.write oDnsQuery.GetZoneContact response.write oDnsQuery.GetBillingContact else response.write oDnsQuery.GetLastErrDescription end if
Set oDnsQuery = Nothing
Samples:
1. Query a single domain name.
oDnsQuery.GetResponse returns the whole query result. ------------------------------------------------------------------- Registrant: Massachusetts Institute of Technology (MIT-DOM) Cambridge, MA 02139
Domain Name: MIT.EDU
Administrative Contact, Technical Contact, Zone Contact: Schiller, Jeffrey I (JIS) jis@MIT.EDU +1 617 253-8400 (FAX) +1 617 258-8736
Record last updated on 14-Jan-94. Record created on 23-May-85. Database last updated on 30-Sep-98 04:31:21 EDT.
Domain servers in listed order:
STRAWB.MIT.EDU [No name] (MIT-STRAWB)
Hostname: STRAWB.MIT.EDU Address: 18.71.0.151 System: MICROVAX running UNIX
Coordinator: Schiller, Jeffrey I (JIS) jis@MIT.EDU +1 617 253-8400 (FAX) +1 617 258-8736
domain server
Record last updated on 15-Jan-90. Database last updated on 30-Sep-98 04:31:21 EDT.
The InterNIC Registration Services database contains ONLY non-military and non-US Government Domains and contacts. Other associated whois servers: American Registry for Internet Numbers - whois.arin.net European IP Address Allocations - whois.ripe.net Asia Pacific IP Address Allocations - whois.apnic.net US Military - whois.nic.mil US Government - whois.nic.gov
W20NS.MIT.EDU 18.70.0.160 BITSY.MIT.EDU 18.72.0.3
The InterNIC Registration Services database contains ONLY non-military and non-US Government Domains and contacts. Other associated whois servers: American Registry for Internet Numbers - whois.arin.net European IP Address Allocations - whois.ripe.net Asia Pacific IP Address Allocations - whois.apnic.net US Military - whois.nic.mil US Government - whois.nic.gov -------------------------------------------------------------------
oDnsQuery.GetRegistrant returns:
Massachusetts Institute of Technology (MIT-DOM) Cambridge, MA 02139
oDnsQuery.GetDomainName returns:
MIT.EDU
oDnsQuery.GetAdministrativeEmail returns:
jis@MIT.EDU Note: This is same for Techical, Zone and Billing contact.
oDnsQuery.GetAdministrativeContact returns: Schiller, Jeffrey I (JIS) jis@MIT.EDU +1 617 253-8400 (FAX) +1 617 258-8736
Note: This is same for Techical, Zone and Billing contact.
oDnsQuery.GetDomainServers returns:
STRAWB.MIT.EDU [No name] (MIT-STRAWB)
oDnsQuery.GetRecordLastUpdateTime returns:
14-Jan-94.
oDnsQuery.GetRecordCreateTime returns:
23-May-85.
oDnsQuery.GetDatabaseLastUpdateTime returns:
30-Sep-98 04:31:21 EDT.
2. Query a single IP:
oDnsQuery.GetResponse returns the whole query result. ------------------------------------------------------------------- [No name] (MIT-W20NS)
Hostname: W20NS.MIT.EDU Address: 18.70.0.160 System: MICROVAX-II running UNIX
Coordinator: Hoffmann, Ron (RH164) hoffmann@MIT.EDU (617) 253-8400
domain server
Record last updated on 09-Sep-88. Database last updated on 11-Oct-98 04:20:45 EDT.
The InterNIC Registration Services database contains ONLY non-military and non-US Government Domains and contacts. Other associated whois servers: American Registry for Internet Numbers - whois.arin.net European IP Address Allocations - whois.ripe.net Asia Pacific IP Address Allocations - whois.apnic.net US Military - whois.nic.mil US Government - whois.nic.gov -------------------------------------------------------------------
oDnsQuery.getHostName returns:
W20NS.MIT.EDU
oDnsQuery.GetCoordinator returns:
Hoffmann, Ron (RH164) hoffmann@MIT.EDU (617) 253-8400
oDnsQuery.GetRecordLastUpdateTime returns:
09-Sep-88.
oDnsQuery.GetDatabaseLastUpdateTime returns:
11-Oct-98 04:20:45 EDT.
3. Query any thing:
Actually you can query anything and get the response from oDnsQuery.GetResponse. But the parse may fail and you may not be able to get a specific field.
4. More questions?
Please contact Andrew, Technical Support at techsupport@dalun.com.