Table of Contents

Class Header

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

Represents the DNS message header, which contains metadata about a DNS request or response.

public class Header
Inheritance
Header
Inherited Members

Constructors

Header()

Initializes a new instance of the Header class.

public Header()

Properties

AdditionalRecordsCount

Gets or sets the count of additional resource records in the DNS message.

public ushort AdditionalRecordsCount { get; set; }

Property Value

ushort

AnswerCount

Gets or sets the number of answer records in the DNS message. This corresponds to the count of resource records in the Answer section of the message.

public ushort AnswerCount { get; set; }

Property Value

ushort

AuthoritativeAnswer

Gets or sets a value indicating whether the responding server is authoritative for the domain name in the query.

public bool AuthoritativeAnswer { get; set; }

Property Value

bool

Id

Gets or sets the identifier for the DNS message header, used to match requests with responses.

public ushort Id { get; set; }

Property Value

ushort

NameserverCount

Gets or sets the count of authoritative nameservers in a DNS response. This property is used to track the number of resource records in the authority section of a DNS message.

public ushort NameserverCount { get; set; }

Property Value

ushort

OpCode

Gets or sets the operation code (OpCode) of the DNS message, which indicates the type of query or operation being performed.

public OperationCode OpCode { get; set; }

Property Value

OperationCode

QueryResponse

Gets or sets a value indicating whether the message is a query (false) or a response (true).

public bool QueryResponse { get; set; }

Property Value

bool

QuestionCount

Gets or sets the number of questions in the DNS message. This represents the count of entries in the question section of the DNS message.

public ushort QuestionCount { get; set; }

Property Value

ushort

Recursion

Gets or sets a value indicating whether recursion is desired by the client or allowed in the server for the DNS operation.

public bool Recursion { get; set; }

Property Value

bool

RecursionAvailable

Gets or sets a value indicating whether recursion is available for the DNS query. This flag is used in DNS responses to signify if the server supports recursive queries.

public bool RecursionAvailable { get; set; }

Property Value

bool

ResponseCode

Gets or sets the response code, indicating the result of the DNS query processing. This code defines the outcome of the DNS operation, such as success, failure, or specific error categories.

public ResponseCode ResponseCode { get; set; }

Property Value

ResponseCode

Truncation

Gets or sets a value indicating whether the DNS message has been truncated. Truncation occurs when the message size exceeds the specified limit.

public bool Truncation { get; set; }

Property Value

bool

Z

Gets or sets the reserved bit field in the DNS message header. This field is reserved for future use and must be set to zero as per RFC specifications.

public ushort Z { get; set; }

Property Value

ushort

Methods

GetBytes()

Converts the header properties into a sequence of bytes for serialization.

public IEnumerable<byte> GetBytes()

Returns

IEnumerable<byte>

A sequence of bytes representing the header data.