-
Notifications
You must be signed in to change notification settings - Fork 838
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
Allow resolv.conf personalization via adding wsl.conf parameter "Link to personal nameserver list" #6399
Comments
Have you considered disabling the auto generation of /etc/resolv.conf and replacing it with a symlink to somewhere shared between distros? Maybe /mnt/c/users/username/resolv.conf? |
I think it will help to stabilize WSL networking. I am working with resolv.conf disabled already a long time. In all Linux distros all applications that use networking assume that /etc/resolv.conf is a link - this is the Linux requirement. During this period I analyzed the resolve daemon logic in systemd based systems and found that resolved makes certain checks before pushing nameserver into the generated resolv.conf under the /run/systemd folder. It ensures that inaccessible or unstable DNS's are never used. DNS provided by my ISP is very unstable and "temporary problems" with the name resolution by this DNS is a frequent situation unrelated to WSL. Linux allows up to 4 nameservers in the resolv.conf list plus up to 4 DNS servers in my router used for DNS forwarding. The situation "temporary unavailable maybe not a bug in WSL networking but only a bug in resolv.conf generation logic. |
@benhillis I tried the following solution:
|
The situation is really bad. When I log in as different users the /etc/resolv.conf is regenerated every time and every time in the wrong way ignoring configuration in wsl.conf generateResolvConf false. ##6404. In some use-cases root and rootless login make a huge difference. If /etc/resolv.conf is not a link created by root and has rw access only for the root user it can be randomly overridden by any user session and DNS resolution will not work in all subsequent sessions. |
Workaround: use genie to start distro using systemd, configure network Manager using its .conf file or nmcli and forget about /etc/resolv.conf. The modern Linux distros use this mechanism and it works even in WSL and complex Local or Home networks. |
I don't think that the issue should be closed, using genie isn't a solution, only a workaround. I'm not a Linux expert, and I don't know how to use genie. |
Is your feature request related to a problem? Please describe.
##5336
Allow other than "auto-generate" or nothing options for resolv.conf creation.
Describe the solution you'd like
I would like to create a personalized resolv.conf file in my home directory and point to this file using the symbolic link in the /etc/ folder
My Android phone has 4 options for DNS selection.
Describe alternatives you've considered
Implementation of network systemd daemon or alternative configurable mechanism to create meaningful resolv.conf file. It can take 1-2 years.
Additional context
I have to edit manually my /etc/resolv.conf files in all WSL distros after every network configuration and availability event in my Router-managed WiFi network. I use my WiFi router as DNS server in 99% of cases. It has DNS forwarding feature and pretty WebGUI for built-in DNS server configuration and testing.
The text was updated successfully, but these errors were encountered: