My /etc/wsl.conf:
[network]
generateResolvConf = false
And yet my /etc/resolv.conf continues to regenerate. I specify:
nameserver 8.8.8.8
Only to find it changed to:
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.29.128.1
Note: I tried the solutions suggested below, none of them helped:
/etc/resolvconf/
, or the last paragraph replacing the symlink with a regular file. – Daniel T Jan 27 '24 at 22:16resolvconf
but for some reason thesystemd
was the first thing that came to my mind. – Terrance Jan 27 '24 at 23:33ls -al /etc/resolv.conf
when you replace it with a regular file? – Daniel T Jan 28 '24 at 00:58-f
flag for robustness, and I slightly cleaned up the commands in my answer – Daniel T Jan 28 '24 at 01:17