Indy 9
TNAMERecord
Hierarchy, Properties, Methods, Unit: IdDNSResolver
Represents a resource record in a DNS response that contains a Host name.
TNAMERecord = class(TResultRecord)
Unit
IdDNSResolver
Description
TNAMERecord is a TResultRecord descendant that represents a resource record returned in the results for a DNS query. TNAMERecord is a collection item created to represent a resource record returned when the RData portion of the response contains data that can recognized as a Host name.

TNAMERecord is the ancestor for other resource record classes that implement a Host name property in the specific context of the resource record type, including TNSRecord, TNSRecord, and TPTRRecord.

TNAMERecord resource record definitions are likely to occur in any DNS response. Because their RData format is known, all host or domain names in the RData section of these resource records may be compressed.

The host name is represented in RData as a series of labels, and terminated by a label with zero length. The first label is a single octet that indicates the length of the host name, and is followed by that number of characters. The length octet is treated as binary information, and the host anme can be up to 256 characters in length (including the length octet).

TNameRecord extends TResultRecord to implement the specifics of accessing RData values as properties, including HostName. TNameRecord also overrides the Parse method to read the values in RData into their property counterparts.


TNAMERecord.HostName
TNAMERecord, See Also
Represents the name of a host server in the RData field of a resource record.
property HostName: string;
Description
HostName is a read-only String property that represents the name of a host server returned in the RData portion of a resource record. HostName is updated when Parse is used to examine the message returned in the DNS server response. HostName is populated by calling TQueryResult to convert the value to a Domain name.

TNAMERecord.Assign
TNAMERecord
Copies property values into the current object instance.
procedure Assign(Source: TPersistent); override;
Parameters
Source: TPersistent
Collection item contain value to be copied.
Description
Assign is a procedure that copies the property values from a collection item specified in ASource to the current object instance. If ASource has the same class type as the current object instance, the required properties are copied. Otherwise the inherited Assign method is called using ASource as an argument.

TNAMERecord.Create
TNAMERecord
Constructor for the object instance.
constructor Create(Collection: TCollection); override;
Parameters
Collection: TCollection
Owner of the collection item.
Description
Create is the constructor for the object instance. Create calls the inherited Create method using Collection as the owner of the collection item.

TNAMERecord.Parse
TNAMERecord
Parses RData values into properties.
procedure Parse(CompleteMessage: String; APos: Integer); override;
Parameters
CompleteMessage: String
Contents of the resource record.
APos: Integer
Position where RData values begin in the answer.
Description
Parse is an overridden procedure that implements a routine to parse resource record values in the DNS response into their property-based counterparts.

CompleteMessage is the contents of the resource record. Since the DNS message can contain compressed data, the whole message is needed for parsing and pointer location.

APos is the position in the resource record where RData values for this record type are located in the DNS Answer.

Parse calls the inherited Parse method, and retrieves the DNS label and value for the HostName property.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.