/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种配置方式 ...
随机推荐
- 【61测试】【dp】【二分】【前缀和】【树剖】
不要问我为什么昨天考的今天才贴解题报告.. 第一题: 给定3个字符串,求它们的最长公共子序列. 解: 考试时知道肯定是LCS的二维再加一维,用三维,可天堂有路你不走,地狱无门你偏来...灵机一动想出来 ...
- jquery 、 JS 脚本参数的认识与使用
jquery . JS 脚本参数的认识与使用 如何使用jquery刷新当前页面 下面介绍全页面刷新方法:有时候可能会用到 window.location.reload(); //刷新当前页面. par ...
- WCF服务开发与调用的完整示例
WCF服务开发与调用的完整示例 开发工具:VS2008 开发语言:C# 开发内容:简单的权限管理系统 第一步.建立WCF服务库 点击确定,将建立一个WCF 服务库示例程序,自动生成一个包括IServi ...
- HDU1005(矩阵快速幂)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1005 #include<cstdio> using namespace std; int ...
- <转>九张图九句话
做个像石灰一样的人,别人越泼你冷水,你的人生越沸腾! 来自为知笔记(Wiz)
- block的语法
主要内容: 1. 开始使用block(Getting Started with Blocks) 2. block概念综述(Conceptual Overview) 3. 声明和创建block(Decl ...
- Ingress qdisc
Ingress qdisc All qdiscs discussed so far are egress qdiscs. Each interface however can also have an ...
- HTML、canvas、video灰度
效果图: 注:本例需在服务器上运行的才能看到效果.视频文件可换成本地视频(HBuilder有集成服务器或者使用wampmanager). 代码如下: <!DOCTYPE html> < ...
- 《统计推断(Statistical Inference)》读书笔记——第6章 数据简化原理
在外行眼里统计学家经常做的一件事就是把一大堆杂七杂八的数据放在一起,算出几个莫名其妙的数字,然后再通过这些数字推理出貌似很靠谱的结论,简直就像是炼金术士用“贤者之石”把一堆石头炼成了金矿.第六章,应该 ...
- 几个排序算法的python实现
几个排序算法 几个排序算法 几个排序算法 冒泡排序 选择排序 插入排序 快速排序 quick sort 冒泡排序 冒泡排序是比较简单的排序方法,它的思路是重复的走过要排序的序列,一次比较两个元 ...