-
Notifications
You must be signed in to change notification settings - Fork 835
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
WSL2 DNS stops working #4285
Comments
Whatever provides the internal WSL2 dns seems busted, but other dns servers are successful:
|
@jordansissel This started happening to me yesterday, but it seems my whole network is busted: $ host -t A google.com 1.1.1.1
;; connection timed out; no servers could be reached
$ ping 8.8.8.8
connect: Network is unreachable Running with AV and Firewall disabled. EDIT: I disabled, restarted, and re-enabled the WSL and Virtual Machine Windows Features and it looks to work now. |
I ran into this same issue; resolved for now after removing |
Maybe it is related to this: #4275 |
Using build: 18932.1000: I ran into this issue on Ubuntu also. Sometimes rebooting windows host and executing |
I am seeing this same DNS behavior on Build 18941. The local DNS server is not responding but I can route out to the internet and everything works fine once I set a manual resolv.conf. Using both the official Kali and Ubuntu distros in the store, converted to WSL 2. I have no other Hyper-V VMs. Ifconfig: bond0: flags=5122<BROADCAST,MASTER,MULTICAST> mtu 1500 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 sit0: flags=128 mtu 1480 |
Facing the same issue on 18956. manually setting resolv.conf is a temporary solution. adding generateResolvConf to false did not affect anything. What's with that ip address (one starting with 172) though? have never seen it before |
Facing the same issue on 18956. Git and Ping does not work. |
My workaround:
|
@klein-hu : tried your workaround, followed your steps, but it doesn't seem to be working for me. My |
Did you enter 'wsl --shutdown' into the cmd?
…________________________________
From: ambar <[email protected]>
Sent: Wednesday, September 11, 2019 2:36 PM
To: microsoft/WSL <[email protected]>
Cc: mahsoommoosa42 <[email protected]>; Comment <[email protected]>
Subject: Re: [microsoft/WSL] WSL2 DNS stops working (#4285)
@klein-hu<https://github.com/Klein-Hu> : tried your workaround, followed your steps, but it doesn't seem to be working for me.
My /etc/resolv.conf file is getting wiped out every time I relaunch wsl2 :-/
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4285?email_source=notifications&email_token=AFA4ITKHNAZWNB7F7W6376LQJCYK7A5CNFSM4H65IQMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6NZ27Y#issuecomment-530292095>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFA4ITLPNO6V63C5UXARNC3QJCYK7ANCNFSM4H65IQMA>.
|
Yes, I did. |
I'm not on Insiders anymore. So, I'm not sure if anything has changed in between.
…________________________________
From: ambar <[email protected]>
Sent: Wednesday, September 11, 2019 11:01 PM
To: microsoft/WSL <[email protected]>
Cc: mahsoommoosa42 <[email protected]>; Comment <[email protected]>
Subject: Re: [microsoft/WSL] WSL2 DNS stops working (#4285)
Yes, I did.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4285?email_source=notifications&email_token=AFA4ITIBLVEDLIBFTQUXDVLQJETQ3A5CNFSM4H65IQMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6PIQ6A#issuecomment-530483320>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFA4ITOQIJFP2RJ6C5KJ6TTQJETQ3ANCNFSM4H65IQMA>.
|
@nonbeing make sure resolv.conf is a file and not a link
|
|
Running insider 10.0.18980.1, kernel 4.19..67 |
Just started seeing this today after an update as well
|
I made a gist with @klein-hu 's instructions. They worked like a charm for me. |
For anyone seeing this, the "fixes" proposed are merely a workaround to the problem. In situations where internal/private DNS servers (eg. corporate or home network), DNS will not resolve as expected. I consider this a critical bug. |
Starting the docker daemon (inside of WSL2) seems to trigger this for me, very reliably.
|
Also, this doesn't seem to be resolved for me by switching to a different nameserver. It seems that after starting docker, eventually all network I/O completely stops working in my WSL2 environment. |
I have reason to believe that this behavior STARTED happening with the latest update of Windows Insider. I'm on build 19013.1. |
I'm on 19018.1 and it's taking sometimes 30 seconds to resolve a name with Google's name servers in /etc/resolve.conf. I uninstalled Docker Desktop and that didn't change the behavior. |
Same symptom here. However, I figured out that :
|
The fix to disable WSL/restart/enable WSL/restart in the "Windows Features" settings fixed it for me. The problem does seem related to the docker daemon. |
This stopped working for me after upgrading to 19033 (slow ring). Disable WSL/restart/enable WSL/restart did not fix it. Note that I don't have the Docker daemon running inside WSL, although I do have it running on the host and exposed to the WSL instance. |
Same here. I did a Windows Update to build 1903. I have a pending Windows Update, will try that today. Edit: It started working again after the update. My best guess would be that restarting the computer helped with this, but I can't really tell ¯\_(ツ)_/¯ |
It's actually even worse: it appears that the ability to tell wsl to stop updating resolv.conf doesn't work anymore, making it really hard to work around this. Here's my /etc/wsl.conf:
But every time my host network changes it's updating resolv.conf anyways. |
I have 10933 (fast ring) and DNS seems to be working fine now. Also, I just disabled/enabled WIFI and that did not overwrite /etc/resolv.conf (I added a comment and the file stayed the same). |
@benhillis Why do you close an unresolved issue? This one (contrary to the duplicit #8365) somehow shows how long is the history, how many users were affected, what they have tried, how many voted to resolve this problem etc. |
Static |
After 3 years of radio silence we finally have Microsoft hard at work trying to solve this: "/dupe #8365" Issue closed, problem solved! Now, all that needs to be done is to lock this thread so nobody can reply anymore. |
With how a lot of people behave here, that seems not that unreasonable really. |
You should self-reflect on why. Every second comment here is you saying "Works for me!". |
It worked for me after a full resignation and reinstalling the whole OS. Wouldn't call that a good solution. |
The higher level problem is that it is inconsistent to reproduce and difficult to diagnose. If WSL2 itself could at least detect and report on this condition, it would help isolate the cause. |
If you are in MS corpnet, you can repo it by installing any Docker after 3.5.2. |
Yes, this also happened to me while using Docker. No VPNs or that kind of stuff. |
Same thing happened to me. I was building a container and it worked fine, but then my computer ran out of space, so WSL2 crashed. I quit Docker, used However, after a few tries, it works. I still don't know what the problem is. |
What I experienced is a little different, on The docker config change is simple. Just the following in
|
Did you report this on the docker repo(s)? |
I had bridge IPs that I think are recreated by the WSL service. I deleted them with some PS commands after screwing them up, then new ones are created when I bring WSL back on line. This fix worked for me within WSL. I haven't used docker extensively on this new machine to verify the docker dns, but I have updated the docker dns on other machines and it worked inside docker containers. FYI, Windows 11 still has the extra adaptors, but you only see them in administrator tools from what I've read. I haven't had the need to dig in there, yet. Windows 10 had them in the standard "network adaptors" screen. |
In case it helps anyone, I have a workaround that I use to "fix" DNS after I connect to my VPN, as that's where I see the issue. In WSL I run
which updates my /etc/resolv.conf file with the correct nameserver from my VPN. After executing this I usually have to also run in Powershell |
It's been a while since I've had this problem, but it happened again today. Typical symptoms -- dns timeouts. Targeting other DNS servers directly works fine (local router's dns, google dns, etc). The default WSL2 dns server does not respond. From further up this thread, lots of reports about firewall issues, so I can report that DNS(1) fails, but then if I disable the Windows Firewall, DNS(1) works again. (1) "DNS" aka the default wsl2 dns server which on my system is some WSL-internal 172.20.128.1 address -- the same address as the default route. Using Hope this helps one of us eventually solve this 🤷♂️ |
From a linked issue, possibly a solution for some of us will be released soon as noted in this comment: #8365 (comment) |
The issue seems to be fixed: #8365 (comment) |
I've tried to solve it for a whole week, thank you a lot @radix, I owe you my soul |
Quick fix that worked for me:
|
Hot take: |
I wasn't having this problem until the newest Windows 11 update that recently occurred as of this post. I've tried all of the fixes mention above. For context, I'm on a VPN using Cisco AnyConnect. I've tried both the Windows 11 version and the Microsoft Store version. I need to access a server on the intranet. (Of which, I do not know the IP of the internal DNS server) As a hotfix, I created a static host file of the ip of the server I needed to ssh into. Kind of a gross fix, but it works if you already know the ip address of the server you need.
and add
|
"After I removed the 172 address from the interface, DNS resolution returned to normal." |
Please fill out the below information:
ver
at a Windows Command Prompt)Microsoft Windows [Version 10.0.18932.1000]
/etc/resolv.conf:
To my knowledge, I didn't change anything. This has happened a few times, and rebooting fixes it. Sometimes just doing
wsl --shutdown
is sufficient to fix it. It correlates with my workstation going to sleep and resuming later with DNS in WSL2 not working.The text was updated successfully, but these errors were encountered: