Response¶
Response is the logical representation of the byte data returned from a DNS query. It is constructed internally (by Resolver.Lookup) from a raw UDP reply byte array and exposes the parsed header flags and resource-record arrays.
Purpose¶
- Parse a raw DNS reply byte array into strongly-typed header flags and resource-record collections.
- Expose the parsed
ReturnCode, questions, and answer/name-server/additional-record arrays to the caller.
Context¶
- Namespace:
SAIF.Framework.DNS - Assembly/package:
SAIF.BOF.Framework.DNS
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| ReturnCode | public ReturnCode ReturnCode { get; } |
The DNS response code from the reply header. |
| AuthoritativeAnswer | public bool AuthoritativeAnswer { get; } |
Whether the responding server is authoritative for the queried domain. |
| RecursionAvailable | public bool RecursionAvailable { get; } |
Whether the responding server supports recursive queries. |
| MessageTruncated | public bool MessageTruncated { get; } |
Whether the reply message was truncated. |
| Questions | public Question[] Questions { get; } |
The questions echoed back in the reply. |
| Answers | public Answer[] Answers { get; } |
The answer-section resource records. |
| NameServers | public NameServer[] NameServers { get; } |
The authority-section (name server) resource records. |
| AdditionalRecords | public AdditionalRecord[] AdditionalRecords { get; } |
The additional-section resource records. |
Behavioral notes¶
Responsehas no public constructor; instances are created internally (internal Response(byte[] message)) byResolver.Lookup.- All properties are read-only and populated entirely during construction from the supplied byte array.
- Enforces BR-007: if an embedded
Questioncannot be parsed, construction aborts andInvalidResponseExceptionis thrown instead of yielding a partially-parsedResponse. - Question/Answer/NameServer/AdditionalRecord arrays are sized directly from the corresponding count fields in the reply header (bytes 4-11) before being populated.
Sources¶
- SAIF.Framework.DNS\Response.cs