/etc/resolv.conf overwritten. Redhat/Centos
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
/etc/resolv.conf overwritten. Redhat/Centos的更多相关文章
- 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 ...
- 解决重启centos后resolv.conf总被清空的问题
解决重启centos后resolv.conf总被清空的问题 最近在机器上装了虚拟机virtualbox,然后安装了centos6.4,安装了免费主机控制面板virtualmin,在本地机器上搭建测试网 ...
- Centos重新启动网络配置文件,/etc/resolv.conf被覆盖或清空问题解决
Centos在执行命令 yum update时报错如下: Could not get metalink https://mirrors.fedoraproject.org/metalink?repo= ...
- 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. ...
- vsftp在REDHAT,CENTOS 5中登录慢的解决办法
vsftp在REDHAT,CENTOS 5中登录慢的解决办法 vsftp在REDHAT,CENTOS 5中不仅登录慢,至少花30秒左右,而且上传文件的速度也受影响, 经过摸索,根本原因在DNS解析上花 ...
- 如何保证修改resolv.conf后重启不恢复?
如何保证修改resolv.conf后重启不恢复? 修改/etc/resolv.conf,重启网卡后,/etc/resolv.conf恢复到原来的状态. CentOS.redhat下面直接修改/etc/ ...
- Redhat/CentOS 制作本地yum源
一.制作本地yum源的场景有: (1) 操作系统ISO文件是通过光驱读取的 (2) 操作系统ISO文件是通过USB设备挂载的 (3) 操作系统ISO文件是被上传到本地文件夹的形式 二. 这3种配置方式 ...
随机推荐
- 常用dos命令 如查询端口号是否被占用
①查询端口号是否被占用掉 在windows命令行窗口下执行:运行--cmdC:\>netstat -aon|findstr "8080" TCP 127.0.0.1:80 0 ...
- mod_cluster启用https协议的步骤
1.生成SSL证书与私钥 Generate Private Key on the Server Running Apache + mod_ssl First, generate a private k ...
- 初学者SQL语句介绍
初学者SQL语句介绍 1.用 Select 子句检索记录 Select 子句是每一个检索数据的查询核心.它告诉数据库引擎返回什么字段. Select 子句的常见形式是: S ...
- 在你决定从事iOS开发前需要清楚的几个问题
作者:David McGraw 翻译:丁丁(jackiehoo) 原文:http://www.xmcgraw.com/what-you-need-to-know-to-start-learning- ...
- juqey.html(),text(),val()
.html()用为读取和修改元素的HTML标签 .text()用来读取或修改元素的纯文本内容 .val()用来读取或修改表单元素的value值. 这三个方法功能上的对比 .html(),.text() ...
- 如何获取EntityManager
1.在容器内部使用,使用@PersistenceContext 来注入.@PersistenceContextprivate EntityManager em;TAG================= ...
- HTML编码规则、CSS属性声明顺序--简介
From AmazeUI:http://amazeui.org/getting-started/html-css-guide HTML 属性顺序 HTML 属性应当按照以下给出的顺序依次排列,确保代码 ...
- Android Framework层Power键关机流程(二,关机流程)
二,关机流程 从前一篇博文我们知道,当用户长按Power键时会弹出(关机.重启,飞行模式等选项)对话框,我们点击关机,则会弹出关机确认对话框.那么从选项对话框到关机确认对话框又是一个什么流程呢.下面我 ...
- yii2-搜索带分页,分页的两种方式
1.文章表关联 <?php //...other code //关联 public function getCate(){ return $this->hasOne(ArticleCate ...
- C#代码示例_定义类
默认情况下,类声明为内部的,即只有当前项目中的代码才能访问它.可以使用internal访问修饰符关键字显示指定. 除了两个访问修饰符关键字(public, internal)外,还可以指定类是抽象的( ...