ubuntu16.04 出现域名解析暂时失败 解决方法

分析原因:

域名解析失败,这可能是与DNS服务器地址有关,通过命令:sudo gedit /etc/resolv.conf ,查看DNS地址为:nameserver 127.0.1.1。整个文件为:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search localdomain

解决方法:

在windows环境下打开cmd,输入:ipconfig /all得到主机的DNS地址:

然后将主机的DNS地址加入到resolv.conf文件中,更改后如下:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
nameserver 2
02.117.0.20

search localdomain


然后重启虚拟机即可

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页