CentOS 7 NetworkManager Keeps Overwriting /etc/resolv.conf
In CentOS or Red Hat Enterprise Linux (RHEL) 7, you can find your /etc/resolv.conf
file, which holds all nameserver configurations for your server, to be overwritten by the NetworkManager.
If you check the content of /etc/resolv.conf
, it may look like this.
$ cat /etc/resolv.conf
# Generated by NetworkManager
search mydomain.tld
nameserver 8.8.8.8
The NetworkManager will assume it has the rights to control /etc/resolv.conf
, if it finds a DNS related configuration in your interface configuration file.
$ grep DNS /etc/sysconfig/network-scripts/ifcfg-*
DNS1="8.8.8.8"
IPV6_PEERDNS="yes"
To prevent Network Manager to overwrite your resolv.conf
changes, remove the DNS1, DNS2, ... lines from /etc/sysconfig/network-scripts/ifcfg-*
.
Now, you can manually change the /etc/resolv.conf
file again, and you should be good to go. NetworkManager will no longer overwrite your DNS nameserver configurations.
参考文章:https://ma.ttias.be/centos-7-networkmanager-keeps-overwriting-etcresolv-conf/
CentOS 7 NetworkManager Keeps Overwriting /etc/resolv.conf的更多相关文章
- Centos重新启动网络配置文件,/etc/resolv.conf被覆盖或清空问题解决
Centos在执行命令 yum update时报错如下: Could not get metalink https://mirrors.fedoraproject.org/metalink?repo= ...
- /etc/resolv.conf overwritten. Redhat/Centos
Prevent /etc/resolv.conf from being blown away by RHEL/CentOS after customizing If you are using RHE ...
- 两个坑-Linux下Network-Manager有线未托管-DNS resolv.conf文件开机被清空
Linux里面有两套管理网络连接的方案: 1./etc/network/interfaces(/etc/init.d/networking) 2.Network-Manager 两套方案是冲突的,不能 ...
- 解决重启centos后resolv.conf总被清空的问题
解决重启centos后resolv.conf总被清空的问题 最近在机器上装了虚拟机virtualbox,然后安装了centos6.4,安装了免费主机控制面板virtualmin,在本地机器上搭建测试网 ...
- CentOS 修改/etc/resolv.conf 重启network后又恢复到原来的状态?
问题描述:CentOS 修改/etc/resolv.conf 执行service network restart后,/etc/resolv.conf又恢复到原来的状态 解决方法:/etc/resolv ...
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
国内服务器在运行命令yum -y install wget的时候,出现: Could not retrieve mirrorlist http://mirrorlist.centos.org/?rel ...
- CentOS yum时出现“Could not retrieve mirrorlist ”的解决的方法——resolv.conf的配置
原因:没有配置resolv.conf 解决方法: 到/etc文件夹下配置resolv.conf增加nameserver IP,如: nameserver 8.8.8.8 nameserver 8.8. ...
- 修改/etc/resolv.conf又恢复到原来的状态?[转]
新装一台机器环境为服务器主板,双网卡,系统为CentOS5.4 ,eth0为内网ip,eth1为公网ip.但是由于在本地测试,设置的内网ip,域名服务器同样使用的是上海本地的域名解析,没有问题,可以上 ...
- 如何保证修改resolv.conf后重启不恢复?
如何保证修改resolv.conf后重启不恢复? 修改/etc/resolv.conf,重启网卡后,/etc/resolv.conf恢复到原来的状态. CentOS.redhat下面直接修改/etc/ ...
随机推荐
- WOW.js – 让页面滚动更有趣
演示1 演示2-仿oppo首页 下载 简介 有的页面在向下滚动的时候,有些元素会产生细小的动画效果.虽然动画比较小,但却能吸引你的注意.比如刚刚发布的 iPhone 6 的页面(查看).如果你希望你的 ...
- IT项目角色标准定义
角色 角色标准定义 项目主管 负责协助项目经理分配资源,确定优先级,协调公司和项目组之间的沟通.保证项目团队一直处于良好的状态中.同时监督项目经理的工作方法,以确保项目以及工件符合公司的发展方向以及用 ...
- PhoneGap安装手顺
http://docs.phonegap.com/getting-started/1-install-phonegap/desktop/
- iOS ASIHTTPRequest详解
ASIHTTPRequest对CFNetwork API进行了封装,并且使用起来非常简单,用Objective-C编写,可以很好的应用在Mac OS X系统和iOS平台的应用程序中.ASIHTTPRe ...
- Intel系列微处理器的三种工作模式
body, table{font-family: 微软雅黑; font-size: 13.5pt} table{border-collapse: collapse; border: solid gra ...
- C语言的函数调用过程
从汇编的角度解析函数调用过程 看看下面这个简单函数的调用过程: int Add(int x,int y) { ; sum = x + y; return sum; } int main () { ; ...
- Azure CLI对ASM,ARM资源的基本操作
本文主要介绍Windows Azure CLI对ASM及ARM资源的基本操作 1.在windows的CMD或Powershell环境下,输入命令:azure,可以查看到当前操作的模式为ASM还是ARM ...
- python初识-day2
1.模块初识 python中的库包括标准库和第三方库,需要使用时可直接导入,导入格式为"import 库模块",例如: import sys #sys为python的标准库 pr ...
- 记录一次tomcat下项目没有加载成功
哥们儿实在太low了,web.xml文件中加载的spring mybatis配置文件和配置的文件不是同一个文件名导致的!
- 【转】nagios 命令解释
nagios 命令解释 check_ssh 界面拼装参数格式如下共3个元素: 命令!端口!连接超时时间 ...