Open sigasigasiga opened 1 month ago
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
0
(#9423), similarity score: 0.73Note: You can give me feedback by thumbs upping or thumbs downing this comment.
hello. thanks for reporting the issue. can you please try either of the following 2 solutions documented at https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#resolve-local-names-in-wsl and let us know if those resolve the issue?
1) keep using networkingMode=nat (as you are currently doing), but disable dnsTunneling 2) use networkingMode=mirrored and do the additional configs from the link above - install libnss-mdns and configure /etc/nsswitch.conf (I see you already have libnss-mdns installed)
@CatalinFetoiu thank you for your reply!
Setting networkingMode=mirrored
didn't help at all.
However, by setting dnsTunneling=false
I managed to get some huge boost -- now it takes whopping 1 second to complete my request!
But I must admit that 1 second is still quite slow comparing to the results I'm getting with using any custom DNS server (e.g. 1.1.1.1
):
$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.28.0.1
$ time getent hosts ${hostname}.local
172.28.0.1 egor-bychin-pc.local
________________________________________________________
Executed in 1.05 secs fish external
usr time 2.32 millis 0.00 micros 2.32 millis
sys time 0.43 millis 435.00 micros 0.00 millis
$ cat /etc/resolv.conf
nameserver 1.1.1.1
$ time getent hosts ${hostname}.local
172.28.0.1 egor-bychin-pc.local
________________________________________________________
Executed in 116.05 millis fish external
usr time 1.95 millis 89.00 micros 1.86 millis
sys time 0.35 millis 355.00 micros 0.00 millis
I think the results may still be greatly improved by some changes on your side
@sigasigasiga thanks for following up regarding networkingMode=mirrored, sorry, I forgot to mention you need to be on a build 2.3.17 for this to work (we made some fixes so that mDNS can work in mirrored mode). Also, you don't need to disable dnsTunneling in this case (disabling it is needed only in NAT mode)
for the case where you see a 1 second delay, could you please collect new networking logs (WslNetworkingLogs) ?
@CatalinFetoiu
regarding networkingMode=mirrored, sorry, I forgot to mention you need to be on a build 2.3.17 for this to work (we made some fixes so that mDNS can work in mirrored mode).
I actually have a newer version of WSL
> wsl --version
WSL version: 2.3.24.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.4169
And the domain still resolves in 10 seconds with networkingMode=mirrored
. Did you mean that I need to downgrade it to 2.3.17
for mirrored networking mode to fix the problem?
Also, you don't need to disable dnsTunneling in this case (disabling it is needed only in NAT mode)
Yes, I got that right from the start: I've done the first test with
[wsl2]
networkingMode=mirrored
#dnsTunneling=false
and the second one with
[wsl2]
#networkingMode=mirrored
dnsTunneling=false
for the case where you see a 1 second delay, could you please collect new networking logs (WslNetworkingLogs) ?
Okay, here's the logs collected from the machine with dnsTunneling=false
set in .wslconfig
. As in previous tests, the command I ran was getent hosts ${hostname}.local
.
@sigasigasiga thanks for sending logs
sorry for the confusion about the WSL build number, I meant to say any build that is 2.3.17 or higher
could you please also collect networkings logs from the mirrored networking case? We should understand why resolution takes 10 seconds there
@CatalinFetoiu WslNetworkingLogs-2024-10-12_03-45-01.zip
Windows Version
Microsoft Windows [Version 10.0.22631.4169]
WSL Version
2.2.4.0
Are you using WSL 1 or WSL 2?
Kernel Version
Linux version 5.15.153.1-microsoft-standard-WSL2
Distro Version
Any, I guess. The bug reproduces on Ubuntu 23.04 and on openSUSE Tumbleweed 20240923
Other Software
on my openSUSE Tumbleweed machine:
avahi-daemon 0.8
libnss-mdns 0.15.1-1.5
systemd 256.5-1.1
Repro Steps
However, if I change my DNS server in
/etc/resolv.conf
, then everything is super fast:Expected Behavior
I get the results in 10 seconds
Actual Behavior
I get the results in 0.00001 seconds
Diagnostic Logs
No response