Class Header
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
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
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
Id
Gets or sets the identifier for the DNS message header, used to match requests with responses.
public ushort Id { get; set; }
Property Value
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
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
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
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
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
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
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
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
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
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.