/etc/resolv.conf overwritten. Redhat/Centos
2014-02-16 16:26
399 查看
Prevent /etc/resolv.conf from being blown away by RHEL/CentOS after customizing
If you are using RHEL 6.X it may be a surprise that editing the /etc/resolv.conf will result in your changes being deleted by the OS.This is because there is a process called NetworkManager that automatically creates /etc/resolv.conf from the settings in /etc/sysconfig/network-scripts/ifcfg-interfacename
To disable this behavior, turn off Network Manager as follows:
/etc/init.d/NetworkManager stop /sbin/chkconfig NetworkManager off
Also in /etc/sysconfig/network-scripts/ifcfg-eth0 adjust NM_CONTROLLED to “no”.
NM_CONTROLLED="no" DNS1=8.8.8.8 DNS2=8.8.4.4 DOMAIN=mydomain.com
Be sure to have the latest yum update as well for some issues around this.
Now you can edit your /etc/resolv.conf with custom settings like below without it being blow away:
search mydomain.com options timeout:1 nameserver 8.8.8.8 nameserver 8.8.4.4
This entry was posted Tuesday, June 25th, 2013 at 5:29 am and is filed under Linux. Follow responses:RSS 2.0
相关文章推荐
- CentOS 7 NetworkManager Keeps Overwriting /etc/resolv.conf
- Centos重新启动网络配置文件,/etc/resolv.conf被覆盖或清空问题解决
- CentOS6.3 重启后/etc/resolv.conf 被还原解决办法
- Centos中修改/etc/resolv.conf又恢复到原来的状态
- CentOS的DNS服务器配置文件/etc/resolv.conf重置问题
- Centos中修改/etc/resolv.conf又恢复到原来的状态
- Centos中修改/etc/resolv.conf又恢复到原来的状态
- centos6.4 /etc/resolv.conf文件改了重启网络就自动还原了
- CentOS6.3 重启后/etc/resolv.conf被还原解决办法
- CentOS6.3 重启后/etc/resolv.conf 被还原解决办法
- Centos中修改/etc/resolv.conf又恢复到原来的状态?
- CentOS重新启动网络配置,文件/etc/resolv.conf会被错误覆盖或清空解决
- Centos中修改etcresolv.conf又恢复到原来的状态_落英缤纷
- CentOS6.3 重启后/etc/resolv.conf 被还原解决办法
- Centos中修改/etc/resolv.conf又恢复到原来的状态
- /etc/resolv.conf文件被复写的解决
- /etc/hosts、/etc/resolv.conf、/etc/hosts.conf
- 用代码获得/etc/resolv.conf文件的最后修改时间和文件内信息
- linux下etc下resolv.conf文件的作用
- DNS域名解析的配置文件/etc/resolv.conf