-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL DNS resolution is really slow #6365
Comments
Same here: after upgrade to Windows 10 20H2 DNS resolver got broken.
All DNS resolve requests takes at least 10 seconds to complete:
|
I can't even ping:
|
Troubleshooting steps suggested by John in my Superuser question helped me to fix DNS resolver: I'm citing here Johns words: Run TCP/IP Reset, DNS Flush Open cmd.exe with Run as Administrator
Test after restarting. This fixes many DNS issues. If the issue remains, try DISM and SFC.
Again restart and test. I had to do the first step two times, and eventually check and install latest Windows Updates. Not sure that was the final fix, but DNS resolver works for me now in both Windows and WSL2 environment. May be this information can also help you. |
Thanks |
@0anton this did not work for me, it is still really slow. Anyway, thanks for your answer. |
@0anton The first three steps fixed it for me. Thank you. However, what worked yesterday did not work today... Investigating. |
@bjwhite-fnal I also had a reoccurrence of the resolver problem next day after applying and troubleshooting steps. I've just repeated those steps again, installed pending Windows updates and DNS resolver works since a week already. Maybe it will also help you just repeat those steps again. I know it sounds weird, but I tried it as per advice of SuperUser user and it helped. |
@0anton Worked first time for me. Thanks! |
For me, it looked like the generated windows dns server in /etc/resolv.conf was acting crazy. Strace showed lookups were timing out in linux while wireshark on the host showed they were being returned in millisconds. Might have something to do with IPv6 lookups vs IPv4. I removed the symlink to /etc/resolv.conf and made my own that uses my LANs DNS. It works wonderfully now but I'll have to reconfigure it any time I connect to a new network. Could use 8.8.8.8 but there is stuff on the LAN that I need resolved by name. This workaround corrected the behavior in ubuntu but not docker-desktop. Here are the steps for the workaround: From linux root
Reboot windows |
I think I found my issue. I had an IPv6 DNS server that I couldn't reach. Running nslookup www.google.com from windows showed an IPv6 server from HE.net that was working until my ISP gave me a new IP a few days ago. I removed the IPv6 config from my edge device reboot windows and docker-desktop is fast again. |
FYI, you do not need to reboot Microsoft Windows OS for any change in WSL2 VM. Just use |
For me, the issue was caused by OpenVPN. After I closed it, I removed the custom resolve.conf and let WSL generate it.
|
Setting a custom DNS server in |
Hi folks, we have put out a new update that aims to address networking issues in WSL. In your More info on this release and the changes can be found here in the blog post. Please note: You need to be on a Windows Insiders version to use the new networking settings (Any channel of Windows Insiders will do, including release preview). If you see the "These are not supported" messages it means that your current Windows version doesn't have support, and you will need to upgrade. These features will eventually be coming to Windows 11 22H2. |
but in my case [wsl2]
#networkingMode=mirrored
dnsTunneling=true |
To sum up my tires:
Executed:
My resolv now has only 1.1.1.1 as nameserver. Still the DNS resolution is slow and times out after 10s (curl)
|
None of the WSL configuration changes helped me, and modifying the In the Windows settings, I set DNS to automatic (via DHCP), and that solved my problem. Previously, I had manually configured DNS over HTTPS using 1.1.1.1. So now I can't use DoH :( |
Environment
Steps to reproduce
Just
ping google.com
in Ubuntu orsudo ping google.com
in KaliExpected behavior
A normal ping operation.
Actual behavior
I'm actually getting the ping after 20 seconds or so, however, if I ping using an ip (8.8.8.8 for example), results are instantaneous. I have to say I tried to reboot WSL and my host, downgrade to WSL 1, setting custom DNS updating /etc/resolv.conf (previously updating /etc/wsl.conf too), and setting manually DNS in the virtual WSL switch. None of them worked and it is kind of desperating because easy tasks like installing packages with apt or similar become really time consuming.
I'm having this behaviour in both, Kali 2020.2 WSL 1 and Ubuntu 20.04 WSL 2.
The text was updated successfully, but these errors were encountered: