Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

save resolv.conf in linux

Jun 19, 2011 4:14PM PDT

Hi,
I use red hat Es 5.5 64 bit..
I find the item nameserver in resolv.conf cannnot be saved.
Everytime ,reboot or restart the netwrok service .
The data in resolv.conf will be removed and clear .
I need to edit it again .
I also try to add DNS1=XX.XX.XX.Xx in ifcfg-eth2 but the same problem
in it , the resolv.conf is still need to edit every network service restart .

So, how to save the resolve.conf about nameserver forever ??
Please advice ...


# cat 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.1.2
nameserver 218.102.32.208
`
#
==========
# cat ifcfg-eth2
# Intel Corporation 82572EI Gigabit Ethernet Controller (Copper)
DEVICE=eth2
BOOTPROTO=none
BROADCAST=10.1.255.255
HWADDR=00:80:82:8F:B4:A2
IPADDR=10.1.1.82
NETMASK=255.255.0.0
NETWORK=10.1.0.0
ONBOOT=yes
GATEWAY=10.1.1.249
TYPE=Ethernet
USERCTL=yes
IPV6INIT=no
PEERDNS=no

#

Discussion is locked

- Collapse -
Answer
Maybe just remove autoconfiguration program?
Jun 20, 2011 6:30PM PDT

Remove resolvconfWink

- Collapse -
Answer
resolv.conf
Jul 5, 2011 3:51PM PDT

<span id="INSERTION_MARKER"><span id="INSERTION_MARKER"> <span id="INSERTION_MARKER"> its look like one of your interface is configured to use DHCP<span id="INSERTION_MARKER"> .if you use DHCP etc/resolv.conf can behave in that manner only