Can't get /etc/resolv.conf to configure after reboot

Posted on 2016-10-13
Last Modified: 2016-11-15
This is a redhat Linux server 6.3.
when I reboot the resolv.conf file has no dns servers listed.

I have a number of VLANs attached to a single interface.  they are set up as ifcfg-eth0:1 through 6
According to the docs I've read the interface config should look something like this:
NAME="System eth0"

It states that in order for resolv.conf to be set up your have to have PEERDNS set to yes and DNS1 and DNS2 set up in the config file.
which I have done.

In the VLAN files I have tried setting PEERDNS to no for all of them and then to yes for all of them. But it still doesn't set up resolv.conf properly.

If looked at the ifup_post script and it looks like it should have done something but I haven't tried debugging them.  I'm working remotely so if I mess up the network scripts, I might not be able to get on.

in the resolv.conf part of the ifup_post script it creates a backup copy of the resolv.conf file.  That backup copy does exist in /etc so that leads me to suspect it's running through the right part of the script.  The really weird thing is, the backup copy has two lines in it for name servers that are not the ones that I use.  They come from an alternate datacenter that we use for other applications.
I've grepped all the files in /etc to see if the ip address exists in any of the files, but nothing showed up.

Not sure what to do next.
Question by:geekdad1
  • 3
  • 3
LVL 61

Expert Comment

ID: 41841504
Option 1 You can disable PEERDNS and use reolv.conf with 2 DNS servers
Option 2 you can add or replace DHCP DNS servers via dhclient.conf or equivalent

You must upgrade your system, with most expensive support option it is 2 years overdue:
In Red Hat Enterprise Linux 6, EUS is available for the following minor releases:
6.3 (ends June 30, 2014)
Alternatively you can upgrade to CentOS or Oracle linux for free.

Author Comment

ID: 41842857
Setting PEERDNS to no on all interfaces doesn't make any difference.
DHCP is not an option . This host has a static IP address.

We are aware of the age of the server and are looking at our options.  Free is not always the best consideration.
LVL 61

Accepted Solution

gheist earned 500 total points
ID: 41843128
Just remove DNS settings from /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0 and customize resolv.conf to your liking (I think DNS in first file overrides 2nd)
Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  


Expert Comment

ID: 41845589
You can enter your desired dns in /etc/resolvconf/resolv.conf.d/head file. This will make sure when server is rebooted, DNS entries from head file are applied in /etc/resolve.conf

Let me know if that helps.

Author Comment

ID: 41864623
No such animal on my system.  However I think since we have virtual ip's running that PEERDNS flag needs to be set to no for all of them except the very first (non virtual) device.  I can't reboot the server just now but I will post again once I get a chance to.
LVL 61

Expert Comment

ID: 41864671
If you want fixed named.conf just make sure NetworkManager does not overwrite it?
resolvconf is debian stuff, you can skip that part ;)

Author Closing Comment

ID: 41888544
Takes a long time to test these things since I can't take the server down except for exceptional circumstances.  Will be moving to a new server soon, so this problem should resolv itself.

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now