-
Notifications
You must be signed in to change notification settings - Fork 822
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
DNS broken - /mnt/wsl is empty - resolv.conf missing #11928
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease 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! Open similar issues:
Closed similar issues:
|
This is a duplicate of #11693. |
As it turned out in #11693 (comment), these issues are not the same. I am completely missing my wsl config whereas theirs is at least present... |
Fyi, I cannot take the logs because I do not have administrator-level access. |
Unfortunately logs are required for us to being able to root cause issue. I'll close for now but feel free to reopen if you can collect logs. |
I have this issue and already posted in #11693. @torgeros Do you have a LAN having a networkadress in the 172.x.x.x. range? @OneBlue In my case this issue appeared after a couple of days having my new notebook when I connected it to the company network |
The only thing in my |
Hi @kohlerdominik the issue you have seems very similar to the issue I am having. I am experiencing a similar issue where WSL is unable to generate and link the I was using mirrored networking mode, but switched back to the default NAT networking mode which fixed the connectivity issues, but I need to use mirrored networking mode due to some issues with port forwarding. |
Hi @oKazuhiro Can you check wether |
The symbolic link does exist at |
@torgeros Thanks. How can we help with fixing the issue? So it seems that we broke the generation of the resolv.conf, presumably by forcing Hyper-V to switch to another IP-address for its virtual network ( |
Found a solution that worked for me. I ended up having to enable IPv6 in the registry. This issue helped me come to this solution: #11002
|
@oKazuhiro So with your fix, the |
The The resolv.conf generation, however, seem to be permanently broken because across system reboots, even without any networks connected, it does not generate that file. |
I was able to solve mine by setting
in |
Woulnd't that bypass host entries on the Windows instance? Meaning, this is more a bandaid than a solution? And is your |
@kohlerdominik Basically, per the docs, And yes, my /mnt/wsl/resolv.conf is back with the following content:
This matches with |
@torgeros Thank you very much, this indeed fixed it for me as well. Still no idea how it broke for |
Just had this issue of resolv.conf missing and the symlink pointing to a non existent resolv.conf in wsl dir. Rebooting wsl did not generate a new resolv.conf. My wslconfig had:
Added explicit params to config but that made no difference:
I created
Then:
|
NOTE: This might be a reopen of #11036
Windows Version
Microsoft Windows [Version 10.0.22631.3880]
WSL Version
2.2.4.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04 LTS
Other Software
Docker is installed (WSL-based backend)
Repro Steps
I don't know
Expected Behavior
accessing the internet being possible inside wsl
Actual Behavior
Every hostname- / url-based network request fails with
Temporary failure in name resolution
. The internet guided me towards the/etc/resolv.conf
file. This file, however, is just a symlink to/mnt/wsl/resolv.conf
which, from what I have read, should be automatically generated every time WSL boots. However, the/mnt/wsl
directory is completely empty. When I create a file inside/mnt/wsl
, it is deleted after a WSL reboot.And obviously, with
/etc/wsl/resolv.conf
not existing, my DNS cannot resolve anything.WSL used to work previously, I do not know when exactly it stopped working.
Diagnostic Logs
/etc/wsl.conf:
The text was updated successfully, but these errors were encountered: