Trumphurst Ltd.

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.

Control Properties

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.

Control Methods

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 on error.

AboutBox() Method

This method is called to display the about box for the DNS OCX control.

Control Events

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 record. 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.

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 query processing.

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.

Links

For more information on any of Trumphurst's products and services, please


This page, and all contents, are Copyright © 1997-2024 by
Trumphurst Ltd.
The Willows
Canalside
St. Martins Moor
Oswestry
Shropshire
SY10 7BH
England.
Contact us
www.trumphurst.com is hosted by JumboCruiser.