Repository navigation
fix: authoritative NODATA with the zone SOA for unconfigured record types - #222
Merged
Merged
Conversation
…ypes A query for a record type the record does not have (e.g. AAAA on an IPv4-only record) was answered with a bare NOERROR: no AA, no SOA. Without the SOA the answer cannot be negatively cached (RFC 2308). The answer now sets AA and carries the zone SOA, taken from the next plugin, with the TTL capped at the SOA MINIMUM. Without a SOA from the next plugin the answer is unchanged. Fail-closed answers are unchanged.
Contributor
Author
|
cc @haosb |
Owner
|
Thanks for fixing this issue! Solid RFC 2308 fix and clean tests. LGTM! |
dmachard
marked this pull request as ready for review
November 12, 2026 13:31
dmachard
approved these changes
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #147 / #148: the expected output in #147 was
flags: qr aawith the zone SOA, but the fix stopped at a bareNOERROR. This PR completes it.Problem
A query for a record type the record does not have (e.g.
AAAAon an IPv4-only record) is answered with a bareNOERROR: noAA, no SOA. Without the SOA the answer cannot be negatively cached (RFC 2308), so resolvers re-ask on every lookup.Impact
Observed on our authoritative servers (IPv4-only backends):
AAAAre-asks for a single name.SERVFAILforAAAAlookups of such names (5 of 6 attempts); an empty non-authoritative answer without a SOA looks like a lame delegation.Change
The answer now sets
AAand carries the zone SOA, which GSLB takes from the next plugin (e.g.file), with the TTL capped at the SOA MINIMUM.fail-closedanswers are unchanged: they depend on backend health and should not be negatively cached./0).Tests
Unit tests added for the three cases above. In
TestServeDNS_FallthroughECSScopeMustBeZeroone assertion is adjusted: the next plugin is now called for the SOA lookup, so the test checks that it does not receive theAAAAquestion.go test -race ./...andgolangci-lint runpass. Integration tests were not run.Reproduce