[PR #3043] [MERGED] Replace DnsLru with a response cache #3516

Closed
opened 2026-03-16 11:47:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3043
Author: @divergentdave
Created: 6/11/2025
Status: Merged
Merged: 6/13/2025
Merged by: @djc

Base: mainHead: david/response-cache


📝 Commits (5)

  • 2c45551 Add a special case for NSEC3 RRsets without RRSIGs
  • b2a23a9 Cache whole responses in recursor
  • 7d30b91 Move TtlConfig
  • 69cff66 Use ResponseCache in resolver
  • 4423ce7 Inline cache_response function

📊 Changes

20 files changed (+943 additions, -1242 deletions)

View changed files

📝 conformance/packages/conformance-tests/src/resolver/dnssec/regression.rs (+0 -1)
📝 crates/proto/src/dnssec/dnssec_dns_handle/mod.rs (+7 -1)
📝 crates/recursor/src/lib.rs (+22 -55)
📝 crates/recursor/src/recursor.rs (+36 -38)
📝 crates/recursor/src/recursor_dns_handle.rs (+70 -68)
📝 crates/resolver/src/caching_client.rs (+91 -69)
📝 crates/resolver/src/config.rs (+3 -3)
crates/resolver/src/dns_lru.rs (+0 -972)
📝 crates/resolver/src/hosts.rs (+3 -7)
📝 crates/resolver/src/lib.rs (+2 -1)
📝 crates/resolver/src/lookup.rs (+1 -1)
📝 crates/resolver/src/lookup_ip.rs (+1 -1)
📝 crates/resolver/src/resolver.rs (+4 -4)
crates/resolver/src/response_cache.rs (+668 -0)
📝 crates/resolver/src/response_cache/ttl_config_deserialize.rs (+1 -1)
📝 crates/server/src/store/recursor.rs (+28 -13)
📝 tests/test-data/test_configs/chained_blocklist.toml (+1 -1)
📝 tests/test-data/test_configs/consulting_blocklist.toml (+1 -2)
📝 tests/test-data/test_configs/example_recursor.toml (+1 -1)
📝 util/src/bin/recurse.rs (+3 -3)

📄 Description

This replaces DnsLru with a new data structure that stores a Message instead of a Lookup, and pushes more specialized logic back to the callers. This closes #2602, and fixes a known issue where glue RRsets could be reused for recursive query responses.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/3043 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 6/11/2025 **Status:** ✅ Merged **Merged:** 6/13/2025 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `david/response-cache` --- ### 📝 Commits (5) - [`2c45551`](https://github.com/hickory-dns/hickory-dns/commit/2c4555182cc11f8a8e93e6404baf55d22e76ca66) Add a special case for NSEC3 RRsets without RRSIGs - [`b2a23a9`](https://github.com/hickory-dns/hickory-dns/commit/b2a23a9563aefafcbc7165d9d573d1eb9ba4255f) Cache whole responses in recursor - [`7d30b91`](https://github.com/hickory-dns/hickory-dns/commit/7d30b91706f81b9f3fad918dad5e0b77160e1ee2) Move TtlConfig - [`69cff66`](https://github.com/hickory-dns/hickory-dns/commit/69cff661f813f359368a17cfe823b7a2aa4da72a) Use ResponseCache in resolver - [`4423ce7`](https://github.com/hickory-dns/hickory-dns/commit/4423ce79b74ded28fea04d986af7b0de04671ff4) Inline cache_response function ### 📊 Changes **20 files changed** (+943 additions, -1242 deletions) <details> <summary>View changed files</summary> 📝 `conformance/packages/conformance-tests/src/resolver/dnssec/regression.rs` (+0 -1) 📝 `crates/proto/src/dnssec/dnssec_dns_handle/mod.rs` (+7 -1) 📝 `crates/recursor/src/lib.rs` (+22 -55) 📝 `crates/recursor/src/recursor.rs` (+36 -38) 📝 `crates/recursor/src/recursor_dns_handle.rs` (+70 -68) 📝 `crates/resolver/src/caching_client.rs` (+91 -69) 📝 `crates/resolver/src/config.rs` (+3 -3) ➖ `crates/resolver/src/dns_lru.rs` (+0 -972) 📝 `crates/resolver/src/hosts.rs` (+3 -7) 📝 `crates/resolver/src/lib.rs` (+2 -1) 📝 `crates/resolver/src/lookup.rs` (+1 -1) 📝 `crates/resolver/src/lookup_ip.rs` (+1 -1) 📝 `crates/resolver/src/resolver.rs` (+4 -4) ➕ `crates/resolver/src/response_cache.rs` (+668 -0) 📝 `crates/resolver/src/response_cache/ttl_config_deserialize.rs` (+1 -1) 📝 `crates/server/src/store/recursor.rs` (+28 -13) 📝 `tests/test-data/test_configs/chained_blocklist.toml` (+1 -1) 📝 `tests/test-data/test_configs/consulting_blocklist.toml` (+1 -2) 📝 `tests/test-data/test_configs/example_recursor.toml` (+1 -1) 📝 `util/src/bin/recurse.rs` (+3 -3) </details> ### 📄 Description This replaces `DnsLru` with a new data structure that stores a `Message` instead of a `Lookup`, and pushes more specialized logic back to the callers. This closes #2602, and fixes a known issue where glue RRsets could be reused for recursive query responses. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:47:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3516
No description provided.