System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

DNS Entries are Gone on Reboot

 
ramizkhan
Advisor

DNS Entries are Gone on Reboot

Environment
==========
HP 580 box
OS: OEL 5.3
Linux: 64 bit



[root@at1oebsap101 etc]# uname -a
Linux at1oebsap101.mycompany.com 2.6.18-128.el5 #1 SMP Wed Jan 21 08:45:05 EST 2009 x86_64 x86_64 x86_64 GNU/Linux



Issue:
=====

Every time I reboot my server DNS Entries from following file gets removed

/etc/resolv.conf

and after reboot "resolv.conf" comes up with just normal template , like following and my NAMESERVER or DNS entries get wiped off.

==================
[root@afsoqatdb102 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

=================


Nothing in /var/log/messages or kernel log for resolv.conf.

Any help would be highly appreciated.

3 REPLIES
Tim Nelson
Honored Contributor

Re: DNS Entries are Gone on Reboot

This is just a guess.

is your server getting its IP address via DHCP ? if so I would suspect that the DHCP server is not providing DNS entries.

either configure static IP and resolv.conf or find the issue on your DHCP server.

ramizkhan
Advisor

Re: DNS Entries are Gone on Reboot

Actually, I just find out the issue

There are 2 solutions for this basically in


/etc/sysconfig/network-scripts/ifcfg-bond0

file has PEERDNS=YES needs to be chaned to PEERDNS=NO

also , if we go here

/etc/sysconfig/networking/profiles/default

network manager keeps the default values of
host
bond or your ethernet values make change there

third solution is this

[root@afsoqatdb102 default]# chkconfig --list NetworkManager
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:on 6:off


look above Networkmanager is ON for run leverl 5 , we need to change it OFF , because every time server reboots Network manager is changing the resolv.conf

thanks


Chhaya_Z
Valued Contributor

Re: DNS Entries are Gone on Reboot

Hi,

If you do not want DHCP server to change your DNS nameserver entry in /etc/resolv.conf then please check the below files:

You can check the configuration files for the interfaces

#cat /etc/sysconfig/network-scripts/ifcfg-ethx ===> check for an entry PEERDNS=no

Example:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme BCM5714 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:15:60:0F:58:4D
ONBOOT=yes
IPADDR=10.154.35.234
NETMASK=255.255.255.192
GATEWAY=10.154.35.254
PEERDNS=no

Note:
PEERDNS=yes|no
modify /etc/resolv.conf if peer uses msdns extension (PPP only) or
DNS{1,2} are set, or if using dhclient. default to "yes".
DNS{1,2}=
provide DNS addresses that are dropped into the resolv.conf
file if PEERDNS is not set to "no".

Please read /usr/share/doc/initscripts-*/sysconfig.txt ==> for more information.

Hope this helps.
Regards,
Chhaya

I am an HP employee.
Was this post useful? - You may click the KUDOS! star to say thank you.