---
title: Question
summary: API reference for Question.
status: draft
owner: <owner>
last_reviewed: 2026-07-23
library: SAIF.Framework.DNS
reference_type: package
---

# 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](../../business-rules.md#br-002-domain-name-length-must-be-1-255-characters), [BR-003](../../business-rules.md#br-003-dnstype-must-be-a-defined-non-none-enum-value), and [BR-004](../../business-rules.md#br-004-dnsclass-must-be-a-defined-non-none-enum-value).
- 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
