RESOLV.CONF Configuration Information Loss resolution

Source: Internet
Author: User
Tags dns2 nameserver

RESOLV.CONF Configuration Information Loss resolution


Configure DNS, modify/etc/resolv.conf, restart service network Restart after modification, modify/etc/resolv.conf information loss, please take a look.

[Code] pre-modification configuration

# No nameservers found; Try putting DNS servers into your

# ifcfg files in/etc/sysconfig/network-scripts like so:

#

# dns1=xxx.xxx.xxx.xxx

# dns2=xxx.xxx.xxx.xxx

# domain=lab.foo.com Bar.foo.com



Baidu on the Internet

Workaround one: Join Dns1=xxx.xxx.xxx.xxx directly in Ifcfg-eth0, then service network restart


Device= "Eth0"

bootproto= "Static"

Hwaddr= "00:0c:29:b5:e4:65"

Nm_controlled= "Yes"

onboot= "Yes"

ipaddr=192.168.128.133

netmask=255.255.255.0

gateway=192.168.128.1

dns1=222.46.120.6



Again to see resolv.conf more a row namerserver xxx.xxx.xxx.xx

# Generated by NetworkManager

NameServer 222.46.120.6


I did not test:



Baidu on the Internet

There are two ways to do it:

Article content:

Vim/etc/resolvconf/resolv.conf.d/head file

Show the same content as resolv.conf:

# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8)

# do not EDIT this FILE by HAND--YOUR changes'll be overwritten)

At the end, type nameserver 202.102.152.3

Save Exit,


Resolvconf-u


At this point, you will be able to surf the internet normally, restart the DNS after restarting.


Failed to test: [[email protected] etc]# Find/-name resolv.conf.d found this file which Linux version of the configuration??




Method Three: (Oneself to others consult, after measured, usable, principle also clear 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0058.gif "alt=" j_0058.gif "/ >)


System environment:

[Email protected] root]# Cat/etc/issuecentos Release 6.2 (Final) Kernel \ r on an \m[[email protected] root]# Uname-alinu x localhost 2.6.32-220.el6.i686 #1 SMP Tue Dec 6 16:15:40 GMT i686 i686 i386 gnu/linux

System Platform:

The firewall is turned on/iptables:firewall is running.

Selinux=enabled




/etc/resolv.conf file configuration, service network Restart restart is lost, mainly caused by NetworkManager services.


1. Modify the/etc/resolv.conf file to add the nameserver that need to be parsed

[[email protected] root]# cat/etc/resolv.conf # Generated by NetworkManager remarks, this is NetworkManager management # No Nameservers Fou nd Try putting DNS servers into your# ifcfg files in/etc/sysconfig/network-scripts like so:## dns1=xxx.xxx.xxx.xxx# dns2=xxx . xxx.xxx.xxx# domain=lab.foo.com Bar.foo.comnameserver 10.1.32.16nameservre 8.8.8.8


2. Change the #nm_controlled in the/etc/sysconfig/network-scripts/ifcfg-eth0 file to No

[Email protected] root]# cat/etc/sysconfig/network-scripts/ifcfg-eth0 device= "eth0" hwaddr= "00:26:9e:27:bf:2f" NM_ Controlled= "no" #NM_CONTROLLED改成noONBOOT = "yes" ipaddr=10.43.5.30netmask=255.255.255.0gateway=10.43.5.253



3. Stop the NetworkManager service

[[Email protected] root]# service NetworkManager Statusnetworkmanager is stopped[[email protected] xjb]#
[Email protected] root]# Chkconfig NetworkManager off



4. Restart the network and check


[[email protected] etc]# cat /etc/resolv.conf # generated by  Networkmanager# no nameservers found; try putting dns servers into  your# ifcfg files in /etc/sysconfig/network-scripts like so:## dns1= xxx.xxx.xxx.xxx# dns2=xxx.xxx.xxx.xxx# domain=lab.foo.com bar.foo.comnameserver  10.1.32.16nameservre 8.8.8.8[[email protected] etc]# service network   restartshutting down interface eth0:                                [  OK  ]Shutting down loopback interface:                            [  ok  ]bringing up loopback interface:                              [  OK  ]Bringing up interface eth0:                                  [  ok  ][[email protected ] etc]# cat /etc/resolv.conf # generated by networkmanager# no  Nameservers found; try putting dns servers into your# ifcfg files  in /etc/sysconfig/network-scripts like so:## dns1=xxx.xxx.xxx.xxx# dns2= Xxx.xxx.xxx.xxx# domain=lab.foo.com bar.foo.com
NameServer 10.1.32.16nameservre 8.8.8.8search localhost[[email protected] etc]#







This article is from the "Ab_linuxer Learning Vegetable Garden" blog, please be sure to keep this source http://ablinuxer.blog.51cto.com/4750670/1693356

RESOLV.CONF Configuration Information Loss resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.