wsl unable to resolve host Temporary failure in name resolution

本文共有486个字,关键词:wsl

问题: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
版权声明:本文为作者原创,如需转载须联系作者本人同意,未经作者本人同意不得擅自转载。
添加新评论
暂无评论