[PR #1920] [MERGED] Add the possibility to shuffle NameServers #2698

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1920
Author: @Edu4rdSHL
Created: 4/14/2023
Status: Merged
Merged: 6/5/2023
Merged by: @bluejekyll

Base: mainHead: shuffle-dns-servers


📝 Commits (10+)

📊 Changes

2 files changed (+21 additions, -2 deletions)

View changed files

📝 crates/resolver/src/config.rs (+3 -0)
📝 crates/resolver/src/name_server/name_server_pool.rs (+18 -2)

📄 Description

Hello, this PR makes it possible to shuffle DNS NameServers to avoid overloads to the first configured ones.

The default value for shuffle_dns_servers is set to true, it greatly improves performance in all kinds of tasks so IMO it makes sense to default to it. For comparison:

A lookup for 11500 hosts, having 1000 resolvers, and using 100 threads takes ~10 minutes to complete, with this change it only takes 55 seconds. That means ~10x of performance increase.

It's the continuation of https://github.com/bluejekyll/trust-dns/pull/1632, I have tried implemeting SmallRng, however I haven't had success because it doesn't implement Send and therefore can't be send between threads safely.

It can be improved in the future, but for now I think that it's a good start.


🔄 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/1920 **Author:** [@Edu4rdSHL](https://github.com/Edu4rdSHL) **Created:** 4/14/2023 **Status:** ✅ Merged **Merged:** 6/5/2023 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `shuffle-dns-servers` --- ### 📝 Commits (10+) - [`79cbce2`](https://github.com/hickory-dns/hickory-dns/commit/79cbce2c02095e62e798a318d8875f238c6005f2) Add the possibility to shuffle NameServers - [`ef2cd4b`](https://github.com/hickory-dns/hickory-dns/commit/ef2cd4be18e7f1e1128523e56f3a3b2142d78737) Set the default value for `shuffle_dns_servers` to false. - [`a0cfff6`](https://github.com/hickory-dns/hickory-dns/commit/a0cfff69cc46b5637445504ad2cdc9c642a0b6d8) Merge branch 'main' of https://github.com/Edu4rdSHL/trust-dns - [`2b04876`](https://github.com/hickory-dns/hickory-dns/commit/2b04876ee884eb3e643665017d6971c68b2fbeb0) update changelog for 0.23 - [`a0ca84d`](https://github.com/hickory-dns/hickory-dns/commit/a0ca84d25f02b4005c4cd322996e4b8940c965bf) update version to 0.23-alpha.1 - [`4d2c50f`](https://github.com/hickory-dns/hickory-dns/commit/4d2c50fd8c2e9aa1980725e13175df2e93068ede) update h2 dependency due to vuln warning - [`42f8c0a`](https://github.com/hickory-dns/hickory-dns/commit/42f8c0a35b5616a506d0be611147a78c2bc59db1) cleanliness updates forrustc 1.69 - [`b42bfdf`](https://github.com/hickory-dns/hickory-dns/commit/b42bfdfc87358012427599964847a60530d02765) cleanup workspace features - [`1db3319`](https://github.com/hickory-dns/hickory-dns/commit/1db33196a8c3501c6c182a22837632b4b17daf32) use workspace for all common package details - [`8c3e58b`](https://github.com/hickory-dns/hickory-dns/commit/8c3e58b3cdd1bf6463a8e158abc230d4fa8b4001) cleanup required features ### 📊 Changes **2 files changed** (+21 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/resolver/src/config.rs` (+3 -0) 📝 `crates/resolver/src/name_server/name_server_pool.rs` (+18 -2) </details> ### 📄 Description Hello, this PR makes it possible to shuffle DNS NameServers to avoid overloads to the first configured ones. The default value for `shuffle_dns_servers` is set to true, it greatly improves performance in all kinds of tasks so IMO it makes sense to default to it. For comparison: A lookup for 11500 hosts, having 1000 resolvers, and using 100 threads takes ~10 minutes to complete, with this change it only takes 55 seconds. That means ~10x of performance increase. It's the continuation of https://github.com/bluejekyll/trust-dns/pull/1632, I have tried implemeting `SmallRng`, however I haven't had success because it doesn't implement `Send` and therefore can't be send between threads safely. It can be improved in the future, but for now I think that it's a good start. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:03:18 +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#2698
No description provided.