centos6.8、centos7的/etc/resolv.conf文件经常性被重置,解决方法如下:
方法一、
0 1 2 3 4 |
[root@db ~]# chkconfig NetworkManager off [root@db ~]# chkconfig --list|grep NetworkManager #centos6.8 NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off [root@db ~]# systemctl stop NetworkManager.service #centos7.x [root@db ~]# systemctl disable NetworkManager |
方法二、
0 1 2 3 |
[root@db ~]# grep DNS /etc/sysconfig/network-scripts/ifcfg-eth0 PEERDNS=no #测试,这个选项没有用 DNS1=114.114.114.114 DNS2=192.168.239.1 |
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!