save resolv.conf in linux

hi,
I use red hat linux .
When I start up network service .
I get below error in eth2
root@vls etc]# service network restart
Shutting down interface eth2: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth2: RTNETLINK answers: File exists
Error adding address 10.1.1.82 for eth2.
[ OK ]
I paste the ifcfg-eth2 in here
[root@vls network-scripts]# 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=yes
So, what is the problem oif error adding address ??
Please advice

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 ...

[root@vls etc]# 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
`
[root@vls etc]#

[root@vls network-scripts]# 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
[root@vls network-scripts]#

Did you manually changed the IP-address from the another active interface to this one.

can you post the output of

/etc/sysconfig/named
/etc/sysconfig/network

No

[root@vls sysconfig]# cat named
cat: named: No such file or directory
[root@vls sysconfig]# cat name*
cat: name*: No such file or directory
[root@vls sysconfig]# cat network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=vls.broadsoft.com
[root@vls sysconfig]#
[root@vls sysconfig]#

It sounds like one of your interfaces is configured to use DHCP. If you use DHCP /etc/resolv.conf can behave in the manner that you are observing.

Chuikingman

I have merged your two threads as they are essentially the same issue.

can you remove the PEERDNS option in the ifcfg-eth2 file.restart the network service and check if still DNS nameserver entries changes in resolv.conf

Can you try below command.
[FONT=&quot]

#service NetworkManager stop

If not..........

#ifconfig -a 

// chose your interface. You can take as references below codes.

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static or dhcp
IPADDR=192.168.10.9
NETMASK=255.255.255.0
DNS1=192.168.10.5
DNS2=192.168.10.4
# 
# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=unix.com.tr
GATEWAY=192.168.10.1
#vi /etc/resolv.conf 
// 192.168.10.4-5
#/etc/init.d/network restart 

If not you can use rc.local file when you reboot machine.

#vi /etc/rc.local
ifconfig  eth0  192.168.x.x netmask 255.255.255.x up
route add default gw 192.168.x.x dev eth0

It is a Bug in Fedora (I do not know in any other), that the resolv.conf file will not save if "networkmanager" is on.

This is the same thing I too did in my fedora-13 but with some slight difference.

# vi /var/systembackup/resolv.conf
nameserver x.x.x.x
nameserver y.y.y.y

then

#vi /etc/rc.local
cp -f vi /var/systembackup/resolv.conf /etc/
###OR you can do --> echo -e "nameserver x.x.x.x \nnameserver y.y.y.y" >> /etc/resolv.conf

This worked perfectly for me.
Good luck.
.