Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2795

Make /etc/resolv.conf changes permanent in WSL 2

$
0
0

On WSL 2, when I try to connect to a website, I get an issue:

$ ping www.google.comping: www.google.com: Temporary failure in name resolution

Now, to fix this, I had to add /etc/wsl.conf with this content:

[network]generateResolvConf = true

And I need to change my /etc/resolv.conf to:

nameserver 8.8.8.8

This works fine.

However when I restart my system, when I shutdown wsl or do anything similar, /etc/resolv.conf is overwritten with the previous value.

Of course, if I change /etc/wsl.conf to the following and restart again:

[network]generateResolvConf = false

The fix mentioned above is gone again.

So how do I make my changes to /etc/resolv.conf permanent on WSL 2?


Viewing all articles
Browse latest Browse all 2795

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>