mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #1968] Extremely slow resolution on Windows #833
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#833
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 @NotNite on GitHub (Jun 12, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1968
Describe the bug
On my machine,
TokioAsyncResolvertakes a very long time to resolve any DNS record - up to a minute! - regardless of domain, record type, or configured DNS servers in Windows. I don't even know why this is happening, because I can't actually repro it on my other machines - only on this specific Windows machine (Linux machines on same network work fine). I encountered this from a library I was using that depends ontrust_dns_resolver. I'm mainly posting this in hopes that anyone has idea for better debugging steps so we can work it out together.To Reproduce
Expected behavior
Not take 20.046 seconds to resolve rust-lang.org.
System:
Version:
Crate: trust_dns_resolver
Version: 0.22.0
@djc commented on GitHub (Jun 12, 2023):
Set up a basic tracing-subscriber to get a feel for which part is slow? Investigate what the system config amounts to on this system?
@bluejekyll commented on GitHub (Jun 12, 2023):
We've had other reports of trust-dns cycling through interfaces on Windows. We don't have a lot of folks contributing to the project from Windows, so it's sadly not as well supported as macOS and Linux. If you do have some time to investigate this, that would be really helpful to this project!
@mat-1 commented on GitHub (Jul 15, 2023):
Note that this can be worked around by specifying a different resolver. The mongodb crate readme has an example.
@Firaenix commented on GitHub (Sep 12, 2023):
I’m also running into this issue, I will do some investigating when I have some time
@mokeyish commented on GitHub (Sep 12, 2023):
Are you sure this can be reproduced? I don't seem to have encountered this problem, it has always been faster. You can download this program from here and see if it is too slow.
https://github.com/mokeyish/smartdns-rs#installing
@Firaenix commented on GitHub (Sep 18, 2023):
I can confirm that the slowdown is due to the amount and type of name_servers returned from the ipconfig crate, at least on my Windows machine. I would assume that depending on the machine it would differ but when trimming the following list down to a single DNS server from my Ethernet adapter, the lookup is in the milliseconds.
trust-dns-resolver is currently taking all adapters, including Virtual Machine adapters and Bluetooth and flat_map-ing the dns_servers in a naive way, if I removed all adapters that are not up, are not WiFi or Ethernet and are not Virtual adapters, it solved the performance issues for me.
I guess there is further discussion that needs to be had around if we do want to include Virtual adapters or bluetooth adapters.
What i've basically done in testing is add the following if statements to the flat_map
Edit: More than happy to make a PR if this quick fix is good enough
Below is the list of adapters that were detected on my machine along with their DNS servers.

@bluejekyll commented on GitHub (Sep 18, 2023):
Yes, this sounds like exactly what others have noticed. I don't know what the "fix" is as I'm not using Windows and can't investigate. If you have a proposed change you'd like to put forward in a PR, I think we'd all be grateful.
@djc commented on GitHub (Sep 19, 2023):
I'd suggest we should use something more like a deny list than an allow list here, to avoid unpleasant surprises? I think it makes sense to require
IfOperStatusUpand denyCsmacd, not sure about the virtual stuff. I think Tailscale might like to be an adapter, for example...@Firaenix commented on GitHub (Sep 28, 2023):
I agree, I'm not sure if there is some generally accepted method of choosing which adapters to use in Windows-land.
In regard to Tailscale on Windows it comes up as an "Unsupported" type adapter and not a virtual adapter so it wasn't impacted by the virtual adapter exclusions but by the Ethernet and Wifi exclusions. Your point still stands though.
It is still surprisingly slow if you still have the WSL adapter in the adapter list though. I also believe that depending on the Windows install/users machine hardware and software installed there will be varying names for virtual adapters so it's hard to just disable them all.
@redactedontop commented on GitHub (Mar 24, 2025):
Why was a fix not implemented yet?
rusqliteis now an optional crate #1765