atenet/dns: return NODATA for non-A queries on actor zone - #1062
Closed
SURAJ KUMAR (krsnaSuraj) wants to merge 1 commit into
Closed
atenet/dns: return NODATA for non-A queries on actor zone#1062SURAJ KUMAR (krsnaSuraj) wants to merge 1 commit into
SURAJ KUMAR (krsnaSuraj) wants to merge 1 commit into
Conversation
The actor zone only had a template IN A block. CoreDNS's template plugin returns SERVFAIL when the zone matches a query name but no template block matches the query type (e.g. AAAA queries issued in parallel with A by strict POSIX resolvers). SERVFAIL is treated as a hard failure, breaking intra-cluster resolution for actor images. Add a template IN ANY block with no answer, which returns NOERROR with an empty answer section (NODATA) per RFC 8020 for names that exist but have no records of the requested type. Fixes agent-substrate#888
Collaborator
|
FYI I already opened a PR for the issue #888 |
Author
|
Thanks for the heads-up Yuan Gao (@ygao-g) — you're right, #874 covers the same ground (Fixes #888) and was opened a week earlier. I compared both implementations:
#874 is the more complete and correct approach — it landed first and handles the negative-caching and NXDOMAIN cases properly. I'll close #1062 in favor of it. Thanks for the catch. |
Author
|
Closing in favor of #874 (same fix, opened earlier, more complete with SOA authority + fallthrough + docs). Thanks Yuan Gao (@ygao-g) for the FYI. |
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.

atenet/dns: return NODATA for non-A queries on actor zone
Fixes #888
Problem
The actor zone only had a
template IN Ablock. CoreDNS'stemplateplugin returnsSERVFAILwhen the plugin's zone matches a query name but no template block matches the query type. Strict POSIX resolvers query A and AAAA in parallel and treat SERVFAIL as a hard failure — breaking intra-cluster resolution for actor images that only have IPv4 addresses.Fix
Add a
template IN ANYblock (with noanswer) that matches the same actor names. Per the CoreDNS template plugin docs, specifying no answer results in a response with an empty answer section and default rcode NOERROR — the NODATA response RFC 8020 expects for a name that exists but has no records of the requested type.Testing
go test ./cmd/atenet/internal/dns/ -count=1— passesgo build ./cmd/atenet/internal/dns/— cleangofmt -l cmd/atenet/internal/dns/— cleanNotes
ANYtemplate comes afterA, so A queries are still answered first.answerin the ANY block → empty NOERROR (NODATA), not NXDOMAIN — the zone apex and empty non-terminals remain distinct (see atenet/dns: actor zone returns NXDOMAIN for empty non-terminals #922).