问题:wsl管理的ubuntu运行ping baidu.com等命令时报错unable to resolve host Temporary failure in name resolution
解决:因为没有生成resolv.conf
方法:
1、在wsl管理的ubuntu中
vim /etc/wsl.conf
增加
generateResolvConf = false
2、在windows的powershell中
wsl --shutdown
3、打开wsl管理的ubuntu
sudo rm /etc/resolv.conf
vim /etc/resolv.conf
增加
nameserver 8.8.8.8
参考:
https://blog.csdn.net/qq_41614928/article/details/117248424