Problem
I have encountered a problem when I ping google.com failed and return some error like “Temporary failure in name resolution”
How to fix
Inside WSL2, create or append file:
/etc/wsl.conf
Put the following lines in the file in order to ensure the your DNS changes do not get blown away
sudo tee /etc/wsl.conf << EOF
[network]
generateResolvConf = false
EOF