Class ResourceRecord
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
readerRecordReaderRecord 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
Name
Gets the owner name of the node to which this resource record pertains.
public string Name { get; }
Property Value
Record
Gets one of the Record* classes.
public Record Record { get; }
Property Value
RecordLength
Gets the length, in octets, of the resource data (RDATA) field for this resource record.
public ushort RecordLength { get; }
Property Value
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
Type
Gets the resource record type, which defines the format of the data in the RDATA field.
public RecordType Type { get; }
Property Value
Methods
IsExpired(DateTime)
Determines whether the resource record is expired based on the response timestamp.
public bool IsExpired(DateTime responseTimeStamp)
Parameters
responseTimeStampDateTimeThe 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.