WSL DNS stuff, Bypassing default settings


Userlevel 7
Badge +22

I wanted to override the default DNS in WSL:

 

add the following section to /ect/wsl.conf (if not present create the file)

[network]
generateResolvConf = false

 

Then restart wls (in powershell wsl --shutdown)

 

Create a normal resolv.conf file and add your dns settings.

 

I also made the file immutable since someone posted that it would be wiped clean on reboot:

sudo chattr +i resolv.conf

 

 


0 comments

Be the first to comment!

Comment