red hat7 系统可以ping通ip地址但是不能ping通域名

在red hat7中ifconfig后出现这样的情况,ens33是物理网卡,与eth0一样只是不同的名字。但是只能ping通ip地址不能ping通域名。

解决方法:

在文件 /etc/resolv.conf文件下更改nameserver的值

加上 nameserver 8.8.8.8  域名解析服务  nameserver 8.8.4.4为备用的

在文件 etc/sysconfig/network-scripts下修改 ifcfg-eth0 或者 ifcfg-ens33文件,设置静态ip地址,

参考网址: https://jingyan.baidu.com/article/455a99508be7cda167277865.html

启动网络服务:service network restart

在里面设置的DNS域名解析服务会影响/etc/resolv.conf文件的值

原文地址:https://www.cnblogs.com/moss-yang/p/7020476.html