An A-only rewrite answers AAAA for that name with NODATA, not NXDOMAIN #300

Merged
claude merged 2 commits from feature/37-rewrite-nodata into develop 2026-11-05 08:48:52 -05:00
Owner

A name that exists only through an A or AAAA rewrite now answers NODATA, not NXDOMAIN, to a query of another type, following owner decision Q-REL-9. NODATA means NOERROR with an empty answer section (RFC 2308 §2.2).

  • Where the change sits. IDnsRewriteEngine.TryBuildNoDataForNxDomainAsync, a default method returning null, is called by DnsQueryProcessingPipeline only when the dispatcher itself produced an NXDOMAIN.
    • Filter, schedule, cookie, TSIG and rewrite answers can never be converted.
    • Answers that are not NXDOMAIN pay nothing extra.
    • The engine builds a new message and never changes the (possibly cached) resolved one.
  • SOA and TTL. The NXDOMAIN's SOA is kept: it is the closest enclosing zone's, which is valid for NODATA there.
    • Its TTL is the lesser of the SOA TTL and MINIMUM (RFC 2308 §3), capped further at the rewrite TTL so a newly added rewrite is not hidden.
    • The RRSIG over the SOA gets the same TTL (RFC 4034 §3), and its signed Original TTL is untouched.
    • With no SOA none is invented, and the answer is not cacheable (RFC 2308 §5).
  • DNSSEC. AA and AD are cleared, and NSEC/NSEC3 and their RRSIGs are dropped, because the denial proof covers a name that now exists. OPT is carried over.
  • Scope.
    • Only A/AAAA rewrites make a name exist; a CNAME rewrite is excluded.
    • Client scoping and disabled rewrites are respected.
    • An NXDOMAIN that carries answers (a real CNAME chain) is left alone.
    • A positive answer from normal resolution passes unchanged.
  • Query log records NOERROR. README rewrite guide updated.

Tests:

  • 23 new tests in DnsRewriteEngineNoDataTests and DnsRewriteNoDataPipelineTests (real pipeline, fake upstream). 11 were red before the change; the rest are controls.
  • Rewrites.Tests 61, Core.Tests 347, Web.Tests 2081. The whole solution passes without Docker, and the Release benchmark build is clean.
  • The verifier passed the change. Its citation finding is fixed in the last commit.

Closes #37

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

A name that exists only through an A or AAAA rewrite now answers NODATA, not NXDOMAIN, to a query of another type, following owner decision Q-REL-9. NODATA means NOERROR with an empty answer section (RFC 2308 §2.2). - **Where the change sits.** `IDnsRewriteEngine.TryBuildNoDataForNxDomainAsync`, a default method returning null, is called by `DnsQueryProcessingPipeline` only when the dispatcher itself produced an NXDOMAIN. - Filter, schedule, cookie, TSIG and rewrite answers can never be converted. - Answers that are not NXDOMAIN pay nothing extra. - The engine builds a new message and never changes the (possibly cached) resolved one. - **SOA and TTL.** The NXDOMAIN's SOA is kept: it is the closest enclosing zone's, which is valid for NODATA there. - Its TTL is the lesser of the SOA TTL and MINIMUM (RFC 2308 §3), capped further at the rewrite TTL so a newly added rewrite is not hidden. - The RRSIG over the SOA gets the same TTL (RFC 4034 §3), and its signed Original TTL is untouched. - With no SOA none is invented, and the answer is not cacheable (RFC 2308 §5). - **DNSSEC.** AA and AD are cleared, and NSEC/NSEC3 and their RRSIGs are dropped, because the denial proof covers a name that now exists. OPT is carried over. - **Scope.** - Only A/AAAA rewrites make a name exist; a CNAME rewrite is excluded. - Client scoping and disabled rewrites are respected. - An NXDOMAIN that carries answers (a real CNAME chain) is left alone. - A positive answer from normal resolution passes unchanged. - **Query log** records NOERROR. README rewrite guide updated. Tests: - 23 new tests in `DnsRewriteEngineNoDataTests` and `DnsRewriteNoDataPipelineTests` (real pipeline, fake upstream). 11 were red before the change; the rest are controls. - Rewrites.Tests 61, Core.Tests 347, Web.Tests 2081. The whole solution passes without Docker, and the Release benchmark build is clean. - The verifier passed the change. Its citation finding is fixed in the last commit. Closes #37 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #37

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The rewrite NODATA comments cite RFC 4034 for the RRSIG TTL and RFC 2308 for uncached negative answers
All checks were successful
Build / Build Binary (macos-amd64) (push) Successful in 0s
Build / Build Binary (linux-arm64) (push) Successful in 1s
Build / Test .NET (pull_request) Successful in 10m15s
Build / Pack and Push NuGet Packages (dhcp) (push) Successful in 1m39s
Build / Build Binary (windows-amd64) (push) Successful in 3m17s
Build / Stage Draft Release (pull_request) Successful in -2m40s
Build / Pack and Push NuGet Packages (dns-core) (push) Successful in 1m53s
Build / Build Binary (linux-amd64) (push) Successful in 0s
Build / Pack and Push NuGet Packages (common) (pull_request) Successful in -2m26s
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -1m29s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -1m20s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in 1m57s
Build / Build Binary (linux-arm64) (pull_request) Successful in -12s
Build / Build Binary (macos-arm64) (push) Successful in 7m52s
Build / Smoke Test the Windows Binary (push) Successful in 18s
Build / Build Arch Linux Packages (push) Successful in 47s
Build / Build Binary (macos-arm64) (pull_request) Successful in 24s
Build / Build Binary (windows-amd64) (pull_request) Successful in 20s
Build / Build and Push Image (push) Successful in -2m29s
Build / Build Binary (macos-amd64) (pull_request) Successful in 5m21s
Build / Build Binary (linux-amd64) (pull_request) Successful in 6m43s
Build / Build and Push Image (pull_request) Successful in -2m30s
Build / Smoke Test the Windows Binary (pull_request) Successful in 17s
Build / Build Arch Linux Packages (pull_request) Successful in -2m20s
Build / Build and Test Deb and RPM Packages (push) Successful in 3m18s
Build / Publish Release (push) Successful in 5s
Build / Pipeline (push) Successful in 0s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -46s
Build / Publish Release (pull_request) Successful in -1s
Build / Pipeline (pull_request) Successful in 0s
6edab87a94
Refs #37

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit ba8e612e1f into develop 2026-11-05 08:48:52 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!300
No description provided.