Closed glasko-dp closed 2 years ago
@glasko-dp after you created /etc/wsl.conf
and restart, /etc/resolv.conf
no longer points to /run/systemd/resolve/stub-resolv.conf
:
root@RIPPER:~# file /etc/resolv.conf
/etc/resolv.conf: broken symbolic link to ../run/systemd/resolve/stub-resolv.conf
Just remove the broken link and create a new /etc/resolv.conf
with your settings.
Thanks for reporting this @glasko-dp.
If generateResolvConf
is set to false then the /etc/resolv.conf
will point to a file that doesn't exist. @elsaco's solution of simply deleting the file should solve the issue.
Version
Microsoft Windows [Version 10.0.19045.2130]
WSL Version
Kernel Version
5.10.102.1
Distro Version
Debian 11
Other Software
No response
Repro Steps
[network] generateResolvConf = false
wsl --shutdown
sudo vi /etc/resolv.conf
nameserver 8.8.8.8
:wq
)Expected Behavior
After following instructions (that I've gleaned from delving through several other bugs related to name resolution issue in WSL2) to make resolve.conf changes permanent, I should be able to save the resolv.conf with the custom nameserver, and this should persist between restarts and reboots. As a bonus, name resolution will work from within WSL2.
Actual Behavior
Get error:
"/etc/resolv.conf" E166: Can't open linked file for writing
Diagnostic Logs
No response