From 6e63d5d02a7685ba2e4c4d7b7bf6d986e54163dc Mon Sep 17 00:00:00 2001 From: Colin Vidal Date: Mon, 19 Jan 2026 13:46:03 +0100 Subject: [PATCH 1/2] fix resolver query response doc In case on positive response, the `rctx_authority_positive()` function is called to scan the AUTHORITY section to find NS servers and related RR (glues) to be cached. The doc says the function was called `rctx_authority_scan()`, but it is called `rctx_authority_positive()`. --- lib/dns/resolver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 6615158261..e68686b4eb 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -861,7 +861,7 @@ get_attached_fctx(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name, * or any records returned in response to a query of type ANY * (rctx_answer_any()). * - Scan the authority section for NS or other records that may be - * included with a positive answer (rctx_authority_scan()). + * included with a positive answer (rctx_authority_positive()). * * 4. rctx_answer_none(): * - Determine whether this is an NXDOMAIN, NXRRSET, or referral. From bc1a66a1d0cef854120189ea8542a4b01f556738 Mon Sep 17 00:00:00 2001 From: Colin Vidal Date: Mon, 19 Jan 2026 15:52:30 +0100 Subject: [PATCH 2/2] resolver: add comment when recursing When a fetch result gets a delegation, `rctx_referral()` sets the `rctx->get_nameserver = true`, which tells the resolver to retry another server, not because of an error with the current server, but simply to follow the delegation. Update the comment of `rctx_nextserver()` which is quite confusing here (as it's not immediately obvious from the code how we recurse when getting a delegation back from a query). Also add a log line, which helps figuring out this is happening. --- lib/dns/resolver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index e68686b4eb..919e518ac9 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -9179,6 +9179,9 @@ again: * rctx_nextserver(): * We found something wrong with the remote server, but it may be * useful to try another one. + * Or nothing is wrong, but the server returned a referral + * (rctx->get_nameservers has been set by rctx_referral()) so we need to try + * again with a new zonecut. */ static void rctx_nextserver(respctx_t *rctx, dns_message_t *message, @@ -9398,6 +9401,7 @@ rctx_done(respctx_t *rctx, isc_result_t result) { if (rctx->next_server) { UNLOCK(&fctx->lock); + FCTXTRACE("nextserver"); rctx_nextserver(rctx, message, addrinfo, result); } else if (rctx->resend) { UNLOCK(&fctx->lock);