Table of Contents

Class Question

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

Represents a DNS question section, which contains information about the domain name being queried, the type of query, and the class of query.

public sealed class Question : IEquatable<Question>
Inheritance
Question
Implements
Inherited Members

Constructors

Question(string, QuestionType, QuestionClass)

Initializes a new instance of the Question class.

public Question(string domainName, QuestionType questionType, QuestionClass questionClass)

Parameters

domainName string

The domain name to query.

questionType QuestionType

The type of query being performed.

questionClass QuestionClass

The class of the query.

Properties

DomainName

Gets the domain name associated with the DNS question.

public string DomainName { get; }

Property Value

string

The domain name being queried.

QuestionClass

Gets the query class for the DNS question, determining the protocol group in use.

public QuestionClass QuestionClass { get; }

Property Value

QuestionClass

The class of the DNS query, such as IN, CS, CH, HS, or Any.

QuestionType

Gets the type of DNS record associated with the question.

public QuestionType QuestionType { get; }

Property Value

QuestionType

The DNS record type being queried, such as A, MX, or TXT.

Methods

Equals(object?)

Determines whether the specified object is equal to the current Question instance.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance, which may be null.

Returns

bool

true if the specified object is equal to the current Question instance; otherwise, false.

Equals(Question?)

Determines whether the current Question instance is equal to another Question instance.

public bool Equals(Question? other)

Parameters

other Question

The Question instance to compare with the current instance, which may be null.

Returns

bool

true if the current Question instance is equal to the other parameter; otherwise, false.

GetBytes()

Converts the question information into a sequence of bytes that can be used in DNS requests or responses.

public IEnumerable<byte> GetBytes()

Returns

IEnumerable<byte>

An enumerable collection of bytes representing the encoded DNS question fields.

GetHashCode()

Generates a hash code for the current instance of the Question class.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Converts the current Question instance to its string representation.

public override string ToString()

Returns

string

A string that represents the current object, including the domain name, class, and type of the query.

Operators

operator ==(Question?, Question?)

Checks whether two Question instances are equal.

public static bool operator ==(Question? left, Question? right)

Parameters

left Question

The first instance to compare, which may be null.

right Question

The second instance to compare, which may be null.

Returns

bool

True if the two instances are equal; otherwise, false.

operator !=(Question?, Question?)

Determines whether two specified Question objects are not equal.

public static bool operator !=(Question? left, Question? right)

Parameters

left Question

The first instance to compare, which may be null.

right Question

The second instance to compare, which may be null.

Returns

bool

true if the two Question objects are not equal; otherwise, false.