Skip to content

Question

Question represents a single DNS query, comprising a domain name (QNAME), a query type (QTYPE), and a query class (QCLASS). It performs extensive argument validation in its public constructor since instances of this type may be created by callers outside the assembly.

Purpose

  • Encapsulate the domain/type/class triple that defines a single DNS query.
  • Validate caller-supplied query parameters before they are used to build a Request.
  • Support internal construction from a Pointer when decoding an embedded question in a Response.

Context

  • Namespace: SAIF.Framework.DNS
  • Assembly/package: SAIF.BOF.Framework.DNS

Public members

Member Signature Purpose
Domain public string Domain { get; } The domain name being queried.
Type public DnsType Type { get; } The query type (QTYPE), e.g. DnsType.MX.
Class public DnsClass Class { get; } The query class (QCLASS), typically DnsClass.IN.
Question(string, DnsType, DnsClass) public Question(string domain, DnsType dnsType, DnsClass dnsClass) Constructs and validates a question from caller-supplied domain/type/class values.

Behavioral notes

  • The class is marked [Serializable].
  • The public constructor enforces BR-002, BR-003, and BR-004.
  • An internal constructor, Question(Pointer pointer), exists for building a Question while decoding an embedded question from a raw Response byte array; it is not part of the public surface.
  • The per-label 63-character domain validation implied by RFC1035 exists only as a commented-out regular expression in the constructor and is not currently enforced.**

Note: Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Framework.DNS\Question.cs