Domain Name Server Lookup OCX Control
Winsock compliant Domain Name Server lookup for your programs
The DNS OCX requires Windows 95, 98, 2000 or Windows NT.
The control requires a design time licence registration file before you can use it in your own programs. However, no licence file is required at run time, so you can distribute it freely to your users.
NameServer String Property
This property can be set at design time or run time. It should contain
either the domain name or IP address of the name server you wish to query.
UseTCP Boolean Property
This property can be set at design time or run time. If this is set to FALSE (default) then the control uses UDP datagrams to query the name server. If it is set to TRUE, the control uses a TCP connection to query the name server. UDP datagrams are much more efficient, but have a fixed maximum size. For large replies (e.g. Zone Transfers), you may need to set this value to TRUE, otherwise the reply will be truncated.
TimeOut Long Property
Set this value to the number of milliseconds (1/1000 sec) to wait for a reply from the name server before timing out the query. The default value is 30000 (30 secs).
LastErrorCode Short Integer Property
This property can be read at run-time to obtain the Winsock error number
if a Winsock error occurred during a lookup.
LastErrorDetail String Property
This property can be read at runtime to obtain a string containing more
information about any error.
Lookup(String name, Short Integer type) Method
Tjis method is called to send a query to the name server. Type should be
one of the types mentioned in the DNS RFC documents (see RFC1035), or 255
to request all records for the name. It returns a Short Integer "id", or 0
This method is called to display the about box for the DNS OCX control.
FoundRecord(Short Integer id, Short Integer type, Long Integer ttl,
String name, String address, String additional) Event
This event is triggered whenever the name server returns a name record
from the query. Note that most queries will return more than one name
When an error occurs while a reply from a name server is being processed,
a FoundRecord event is triggered with a type of 0, a ttl of 0, a name
containing the error code, and address and additional containing more
information about the error.
- id relates this record back to the Lookup call which generated it.
- type indicates which type of name record - see RFC1035 for a list
- ttl is the "Time To Live" - the number of seconds you can cache this
record before having to look it up again in case it has changed.
- name - the name part of the DNS record.
- address - the address part of the record (if it is an address record),
or some other detail if it is not.
- Any additional information supplied with the record. Where a record
contains multiple pieces of information, they are separated by tab
FinishedLookup(Short Integer id) Event
This event is triggered after all records for this query have been processed.
Either all the records have been returned, or there was an error during the
This event lets you know you can tidy up any information you hold about a
lookup, because no more FoundRecord events will be triggered for it.
For more information on any of Trumphurst's products and services, please
- Contact us using our contact form
- Phone us at +44 1691 659510
(In the U.K., replace "+44" with "0". Elsewhere,
replace "+" with your international dialling code.)
This page, and all contents, are Copyright © 1997-2017 by
St. Martins Moor
www.trumphurst.com is hosted by JumboCruiser.