Linux /etc/resolv.conf DNS服务器IP地址修改被覆盖问题

为了临时修改DNS服务器IP地址,可能会选择手动修改 /etc/resolv.conf 文件,而在重启Network Manager服务后(sudo systemctl restart NetworkManager),resolv.conf 文件又会被替换成Network Manager配置的DNS服务器IP。

https://www.ibm.com/support/pages/etcresolvconf-file-gets-replaced-every-boot-due-rhel-network-manager-how-can-we-stop-it-and-it-going-effect-powervc-functionality
/etc/resolv.conf file gets replaced at every boot due to RHEL Network Manager. How can we stop it and is it going to effect PowerVC functionality?
Troubleshooting

Problem
/etc/resolv.conf file gets replaced at every boot due to RHEL Network Manager.
Resolving The Problem
1.Can you change the network manager to not do that or to disable it? 

Yes

2. Is network manager requires for PowerVC to work?

No

3. Is it going to effect PowerVC?

No

 To make sure that Network Manager will no longer modify your DNS configuration, you could simply stop using it and revert to the original networking manager.  To make changes to the active, running system, only effective from now until next reboot:

 

systemctl stop NetworkManager

systemctl start network

​

To make the changes permanent, effective at the next reboot and all future reboots, issue the following commands: 

systemctl disable NetworkManager

systemctl enable network

你可能感兴趣的:(linux,DNS)