In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to reset resolv.conf after CentOS restart. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
Recently, when modifying the dns of a CentOS server, it was found that the DNS would be forcibly restored as long as the server was restarted. The solution is as follows:
1. First, modify the value of NM_CONTROLLED in the Nic settings:
Modify the contents of the file / etc/sysconfig/network-scripts/ifcfg-eth0:
NM_CONTROLLED= "no" / / whether to allow Network Manager management, set to no
Network Manager is allowed to manage DNS by default, so set it to no first, and then manipulate the DNS setting
2. Set the content of DNS:
You can modify DNS in the following two ways:
①, modify Nic settings:
Modify the content in / etc/sysconfig/network-scripts/ifcfg-eth0:
PEERDNS= "yes" DNS1= "xxx.xxx.xxx.xxx" DNS2= "xxx.xxx.xxx.xxx"
This setting scheme is based on the DNS set in the network card, which is automatically generated in resolv.conf according to the DNS content set by the network card. If you want to modify the DNS later, you must modify the settings in the network card so that the DNS setting will not fail after the server is restarted.
②, directly modify the value of / etc/resolv.conf:
PS. It should be noted that to ensure that the directly modified DNS content will not be lost after the server restart, you need to set the value of PEERDNS in the Nic to no:
Nameserver xxx.xxx.xxx.xxxnameserver xxx.xxx.xxx.xxx
3. Restart the Nic after modification:
Service network restart
Restarting the server DNS settings will not occur after modifying the DNS settings according to any of the above scenarios.
The above is all the contents of the article "what to do if resolv.conf is reset after CentOS restart". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.