mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #3356] Invalidate individual cache entries in hickory-resolver #1172
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#1172
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @conradludgate on GitHub (Nov 20, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3356
Is your feature request related to a problem? Please describe.
In
hickory-resolver, it seems there's currently no way to invalidate the cache of a specific entry.Describe the solution you'd like
On both
ResolverandDnsLru, I would like to have an option to invalidate entries for a given query.Happy to contribute a PR if desired.
Describe alternatives you've considered
A working alternative for now is to set the cache size to 0 and implement our own caching on top of
ResolverAdditional context
We are planning to use DNS to implement service discovery. When we want to connect to the service leader, we need to scan over the entire service IP list to detect the leader.
The reason we want to invalidate the cache is that this IP list might not contain the primary under certain circumstances, and thus we would want to try the discovery process again, fetching an up to date list of IPs from the upstream nameserver.
The reason we want to invalidate individual cache entries is that we have thousands of such services that perform their own individual leader elections. We wouldn't want to use
clear_cache()as that would be an unnecessary performance hit for the services that are stable.@djc commented on GitHub (Nov 20, 2025):
This seems pretty niche, but if it's reasonably self-contained I'm happy to review.