公司RedHat5.5系统,配置了/etc/resolv.conf文件后重启网络服务,此文件内容就被复写了。经过查看红帽官方文档,给出以下解决办法。https://access.redhat.com/site/solutions/61921
问题主要原因是启用了networkmanager服务,个人觉得是此服务接管了原有的网络设置。
解决办法是配置networkmanager的配置文件。
1.创建一个脚本。vim /etc/NetworkManager/dispatcher.d/15-resolv
内容为:
# vim /etc/NetworkManager/dispatcher.d/15-resolv
#!/bin/bash
#
# Description : script to override default resolv.conf file
# with customized file.
cp -f /etc/resolv.conf.custom /etc/resolv.conf
2.设置文件权限
# chmod u+x /etc/NetworkManager/dispatcher.d/15-resolv
3.创建一个文件 vi /etc/resolv.conf.custom
nameserver xx.xx.xx.xx
options single-request-reopen
4.重启服务
service NetworkManager restart