美文网首页
linux中"Could not resolve host"的问

linux中"Could not resolve host"的问

作者: 伤了谁疼111 | 来源:发表于2018-12-11 21:53 被阅读0次

在虚拟机上仅开一个网卡,设置了仅主机模式,他是访问不了外网的

解决办法

1.设置网关和DNS

#vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
image.png

2.在自己的计算机里改一下属性。

image.png image.png image.png
这时候你会发现仅主机网卡的IP地址已经变了,所以改一下他的IP地址。
image.png
5.重新启动
#ifdown enp0s3 && ifup enp0s3

相关文章

网友评论

      本文标题:linux中"Could not resolve host"的问

      本文链接:https://www.haomeiwen.com/subject/qthyhqtx.html