WSL2: Temporary Failure in Name Resolution
In WSL2, run:
# remove existing resolv.conf symlink that is pointing to a wrong nameserver
sudo rm /etc/resolv.conf
# create a new resolv.conf with a correct nameserver
sudo bash -c 'echo "nameserver 1.1.1.1" > /etc/resolv.conf'
# stop wsl from regenerating resolv.conf symlink
sudo bash -c 'printf "[network]\ngenerateResolvConf = false" > /etc/wsl.conf'
# make current resolv.conf immutable so that wsl does not delete it
sudo chattr +i /etc/resolv.conf
In powershell, run
wsl --shutdown
wsl
更多推荐
适用于windows的ubuntu子系统出现WSL2:Temporary Failure in Name Resolution解决方法
发布评论