Table of Contents

Class ResourceRecord

Namespace
Ubiety.Dns.Core.Records
Assembly
Ubiety.Dns.Core.dll

Represents a DNS resource record as defined in RFC 1035.

public class ResourceRecord
Inheritance
ResourceRecord
Derived
Inherited Members

Remarks

A resource record provides information about a DNS entity, including its name, type, class, time-to-live, record length, and resource data.

Constructors

ResourceRecord(RecordReader)

Initializes a new instance of the ResourceRecord class.

protected ResourceRecord(RecordReader reader)

Parameters

reader RecordReader

Record reader of the record data.

Properties

Class

Gets the class of the resource record, represented by a two-octet code as specified in the DNS RR CLASS definitions.

public OperationClass Class { get; }

Property Value

OperationClass

Name

Gets the owner name of the node to which this resource record pertains.

public string Name { get; }

Property Value

string

Record

Gets one of the Record* classes.

public Record Record { get; }

Property Value

Record

RecordLength

Gets the length, in octets, of the resource data (RDATA) field for this resource record.

public ushort RecordLength { get; }

Property Value

ushort

TimeToLive

Gets the time interval, in seconds, that the resource record may be cached before the source of the information must be consulted again. A zero value indicates the record cannot be cached and is valid only for the ongoing transaction.

public uint TimeToLive { get; }

Property Value

uint

Type

Gets the resource record type, which defines the format of the data in the RDATA field.

public RecordType Type { get; }

Property Value

RecordType

Methods

IsExpired(DateTime)

Determines whether the resource record is expired based on the response timestamp.

public bool IsExpired(DateTime responseTimeStamp)

Parameters

responseTimeStamp DateTime

The UTC timestamp from the response for the record.

Returns

bool

True if the resource record is expired; otherwise, false.

Remarks

Compared in UTC to match TimeStamp, so a daylight saving transition cannot expire a record an hour early or keep it an hour too long.

ToString()

Returns a string representation of the resource record.

public override string ToString()

Returns

string

A string containing the record's name, time-to-live, class, type, and associated record data.