Monday, January 3, 2022

WSL2 - Temporary failure in name resolution

WSL2 is good thing, but dunno why some bug it never fixed.

If you are first time install WSL2 and reboot or something like it, it may become no internet connectivity and show error
Temporary failure in name resolution

To fix it, please follow this gitgub issue, JohnnyQuest1983's reply.

The steps can be simple like this
  1. set generateResolvConf=false in /etc/wsl.conf
  2. set dns in /etc/resolv.conf


then use exit or wsl --shutdown, reboot wsl, and it worked, the internet back.