]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use original query name when caching SERVFAIL 5983-servfail-cache-cname 12158/head
authorColin Vidal <colin@isc.org>
Mon, 1 Jun 2026 14:58:45 +0000 (16:58 +0200)
committerColin Vidal <colin@isc.org>
Tue, 2 Jun 2026 09:19:01 +0000 (11:19 +0200)
commit46d9fb22f5baeed5023dd0fc015b26ec81bf9f06
tree67847974aa53be9c8e946f57eabedf391ed80a18
parent878987b0cdb4260307914627eb262e1c1688f916
Use original query name when caching SERVFAIL

Instead of using `client->query.qname` when caching a SERVFAIL answer,
use `client->query.origqname` when available.

This avoids caching a SERVFAIL against a CNAME target when the failure
occurs while the resolver is following the CNAME chain. This is
problematic, for instance, when the SERVFAIL is triggered by the
`max-query-count` threshold being reached, which would incorrectly
prevent legitimate resolution of the CNAME target while in the SERVFAIL
cache.

Note that if the SERVFAIL genuinely originated from resolving the CNAME
target, that specific failure will no longer be cached, and a direct
query for the CNAME target will trigger a fresh (likely failing)
resolution attempt. However, this is still preferable to the previous
behaviour, which would wrongly prevent resolving the CNAME target if it
was cached for other reasons (like the example above).
lib/ns/client.c