Topic Path: Symbol Reference > Classes > TResultRecord Class
ContentsIndexHome
PreviousUpNext
TResultRecord Class

Collection item used to represent resource records returned by a DNS query.

File
TResultRecord = class(TIdCollectionItem);

TResultRecord is a TCollectionItem descendant that represents resource records returned in the results for a DNS query. TResultRecord contains data associated with names, aliases, and internet addresses in the tree-structured Domain Name Space. 

Resource records are returned in the Answer, Authority, and Additional sections of a DNS response, and they all share the same format: a variable number of resource records, where the number of records is specified in the corresponding count field in the header. 

A resource record has the following format: 

 

 

Field 
Description 
NAME 
Domain name to which this resource record pertains. 
TYPE 
Two octets containing one of the encoded resource record type codes. TYPE specifies the meaning of the data in the RDATA field. 
CLASS 
Two octets which specify the class of the data in the RDATA field. 
TTL 
32-bit unsigned integer that specifies the time interval (in seconds) that the resource record may be cached before it should be discarded. Zero values are interpreted to mean that the resource record can only be used for the transaction in progress, and should not be cached. 
RDLENGTH 
16-bit unsigned integer that specifies the length in octets of the RDATA field. 
RDATA 
A variable length string of octets that describes the resource. The format of this information varies according to the TYPE and CLASS of the resource record. For example, the if the TYPE is A and the CLASS is IN, the RDATA field is a 4 octet ARPA Internet address. 

 

TResultRecord provides properties that represent the values found in a resource record, including the resource record type, resource class, Time-To-Live, data for the resource record, and the length of data in the resource record. 

TResultRecord also provides methods to handle parsing of raw data from a DNS query response, and storing the resulting values in properties for the object instance. 

TResultRecord is also an ancestor class for other resource record types such as TARecord, TCNRecord, THINFORecord, TMINFORecord, TMXRecord, TNAMERecord, TNSRecord, TPTRRecord, TRDATARecord, TSOARecord, TTextRecord, and TWKSRecord. These descendant classes provide additional properties used for labels in the RDATA field that are specific to the resource class and resource record type. 

TResultRecord is the type used to represent collection items maintained in the TQueryResult collection, and the item class returned when accessing the resource records returned by a DNS query in TIdDNSResolver.QueryResult.Items.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.