Show / Hide Table of Contents

Class DnsHeader

Represents a DNS header, the first entry in a DnsMessage. See DnsQueryFactory for methods to create DNS headers for specific purposes.

Inheritance
Object
DnsHeader
Implements
IDnsByteArrayReader
IDnsByteArrayWriter
Namespace: Ae.Dns.Protocol
Assembly: Ae.Dns.Protocol.dll
Syntax
public sealed class DnsHeader : IEquatable<DnsHeader>, IDnsByteArrayReader, IDnsByteArrayWriter

Properties

| Improve this Doc View Source

AdditionalRecordCount

The number of additional records in this header.

Declaration
public short AdditionalRecordCount { get; set; }
Property Value
Type Description
Int16

A count of the number of additional records in this header.

| Improve this Doc View Source

AnswerRecordCount

The number of DnsMessage records in this header.

Declaration
public short AnswerRecordCount { get; set; }
Property Value
Type Description
Int16

A count of the number of answers contained within this DNS message.

| Improve this Doc View Source

AuthoritativeAnswer

Determines whether the answer was from an authoritative DNS server.

Declaration
public bool AuthoritativeAnswer { get; set; }
Property Value
Type Description
Boolean

If true, this DNS answer is authoritative.

| Improve this Doc View Source

Host

The DNS host to use, for example "example.com".

Declaration
public string Host { get; set; }
Property Value
Type Description
String
| Improve this Doc View Source

Id

Gets or sets the unique ID of this DNS query.

Declaration
public ushort Id { get; set; }
Property Value
Type Description
UInt16

A unique ID which allows the sender/receiver to identify this DNS message (for example if the transport protocol is stateless).

| Improve this Doc View Source

IsQueryResponse

Determines whether this is a DNS query or answer.

Declaration
public bool IsQueryResponse { get; set; }
Property Value
Type Description
Boolean

For DNS queries this is false, for DNS responses this is true.

| Improve this Doc View Source

NameServerRecordCount

The number of name server records in this header.

Declaration
public short NameServerRecordCount { get; set; }
Property Value
Type Description
Int16

A count of the number of DNS name server records in this header.

| Improve this Doc View Source

OperationCode

Determines the operation code for this DNS header.

Declaration
public DnsOperationCode OperationCode { get; set; }
Property Value
Type Description
DnsOperationCode

The DNS operation code for this DNS answer. For example QUERY.

| Improve this Doc View Source

QueryClass

The DnsQueryClass of this header, normally IN (Internet).

Declaration
public DnsQueryClass QueryClass { get; set; }
Property Value
Type Description
DnsQueryClass

The class of query, most likely IN to represent Internet DNS queries.

| Improve this Doc View Source

QueryType

The DnsQueryType of this header.

Declaration
public DnsQueryType QueryType { get; set; }
Property Value
Type Description
DnsQueryType

If the type of query is A, it means the query is for IP address records.

| Improve this Doc View Source

QuestionCount

The number of questions in this header.

Declaration
public short QuestionCount { get; set; }
Property Value
Type Description
Int16

A count of the number of questions asked of the DNS server.

| Improve this Doc View Source

RecursionAvailable

Indicates whether recursion is available.

Declaration
public bool RecursionAvailable { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

RecursionDesired

Indicates whether recursion is desired on this DNS query. If this is an answer, indicates whether the original query requested recursion.

Declaration
public bool RecursionDesired { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

ResponseCode

The DnsResponseCode for this result.

Declaration
public DnsResponseCode ResponseCode { get; set; }
Property Value
Type Description
DnsResponseCode
| Improve this Doc View Source

Tags

A generic bag of tags associated with this object. Will not be serialised and/or passed over the wire.

Declaration
public IDictionary<string, object> Tags { get; }
Property Value
Type Description
IDictionary<String, Object>
| Improve this Doc View Source

Truncation

Determines whether this DNS answer was truncated due to size.

Declaration
public bool Truncation { get; set; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

Equals(DnsHeader)

Declaration
public bool Equals(DnsHeader other)
Parameters
Type Name Description
DnsHeader other
Returns
Type Description
Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
| Improve this Doc View Source

ReadBytes(ReadOnlyMemory<Byte>, ref Int32)

Read from the specified byte array, starting at the specified offset.

Declaration
public void ReadBytes(ReadOnlyMemory<byte> bytes, ref int offset)
Parameters
Type Name Description
ReadOnlyMemory<Byte> bytes

The byte array to read from.

Int32 offset

The offset to start at.

| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
| Improve this Doc View Source

WriteBytes(Memory<Byte>, ref Int32)

Write to the the specified byte array.

Declaration
public void WriteBytes(Memory<byte> bytes, ref int offset)
Parameters
Type Name Description
Memory<Byte> bytes

The byte array to read from.

Int32 offset

The offset to start at.

Implements

IDnsByteArrayReader
IDnsByteArrayWriter
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX