Skip to content
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.conf generateResolvConf = false always deleted /etc/resolv.conf #9074

Closed
1 of 2 tasks
kkbruce opened this issue Oct 27, 2022 · 2 comments
Closed
1 of 2 tasks

wsl.conf generateResolvConf = false always deleted /etc/resolv.conf #9074

kkbruce opened this issue Oct 27, 2022 · 2 comments

Comments

@kkbruce
Copy link

kkbruce commented Oct 27, 2022

Version

Microsoft Windows [Version 10.0.22000.978]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 20.04

Other Software

None.

Repro Steps

I want to set up the company nameserver to /etc/resolv.conf.

step 1:

Ref doc https://learn.microsoft.com/en-us/windows/wsl/wsl-config add /etc/wsl.conf and config:

[network]
generateResolvConf = false

step 2:

Close WSL terminal and run wsl --shutdown to restart the WSL instance. Open a new WSL terminal.

step 3:

ls /etc confirm folder, no /etc/resolv.conf file. sudo nano /etc/resolv.conf set up company nameserver.

step 4:

re-step 2, if WSL instance restart, /etc/resolv.conf always is deleted. We must set up a new /etc/resolv.conf for every restart WSL instance.

Expected Behavior

[network]
generateResolvConf = false

My understanding is to turn off the auto-generating function, But he seems to have deleted the ResolvConf function. I need persistence to be set in the /etc/resolv.conf file.

Actual Behavior

Every restart WSL instance, always deleted /etc/resolv.conf.

Diagnostic Logs

No response

@haomingz
Copy link

Same issue here, I temporarily fixed the issue by using chattr +i /etc/resolv.conf.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants