hostip: only cache negative resolves for authoritative answers

Closes #22302
This commit is contained in:
Graham Campbell 2026-07-12 03:58:18 +01:00 committed by Daniel Stenberg
parent 353d05ef0c
commit c3ae9ef822
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 253 additions and 22 deletions

View file

@ -185,7 +185,13 @@ Makes ever threaded resolve experience an initial delay in milliseconds.
## `CURL_DBG_RESOLV_FAIL_DELAY`
With a threaded resolver, delay each lookup by the given milliseconds
and give a negative answer.
and fail it, as if a transient resolver failure happened.
## `CURL_DBG_RESOLV_FAIL_NEGATIVE`
With a threaded resolver, make a lookup failing via
`CURL_DBG_RESOLV_FAIL_DELAY` count as an authoritative negative answer,
eligible for negative DNS caching, instead of a transient failure.
## `CURL_DBG_RESOLV_FAIL_IPV6`

View file

@ -53,7 +53,9 @@ libcurl prunes entries from the DNS cache if it exceeds 30,000 entries no
matter which timeout value is used. (Added in version 8.1.0)
Since curl 8.16.0, failed name resolves are stored in the DNS cache for half
the set timeout period.
the set timeout period. Since curl 8.22.0, this only happens when the
resolver answered that the name does not exist, not on transient or local
resolver failures.
# DEFAULT