Centos 7 Network Manager overwriting resolv.conf


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 05-18-2016
RedHat Centos 7 Network Manager overwriting resolv.conf

Hi all,

I need to add domain and search parameters to resolv.conf, however network manager overwrites.

Setting the PEERDNS=No in the interface file seems to have no effect on this behaviour.

Sadly I cannot just disable NM as these are not my hosts, I'm just attempting to install a platform on them.

If I can modify Network Manager's behaviour over CLI or get it to enforce my chosen pragmas either would be great.

Thanks in advance...
# 2  
Old 05-18-2016
Hi,

I'd think that the best way might be to modify the file and then run;

Code:
# chattr +i /etc/resolv.conf

This will stop the file being modified - However if the server is using DHCP to pick up it's IP lease you may have problems if the lease expires.

Regards

Gull04
This User Gave Thanks to gull04 For This Post:
Skrynesaver (05-18-2016)
# 3  
Old 05-18-2016
I discovered the joys of adding the DOMAIN=... pragma to /etc/sysconfig/network-scripts/ifcfg-${INTERFACE_ID}

Thanks all
# 4  
Old 05-18-2016
Quote:
Originally Posted by Skrynesaver
I discovered the joys of adding the DOMAIN=... pragma to /etc/sysconfig/network-scripts/ifcfg-${INTERFACE_ID}

Thanks all
With the command nmcli you could let it do it for you.

Code:
nmcli con mod "<your connection name here>" ipv4.dns-search <your domain search here>
nmcli con mod "<your connection name here>" ipv4.dns <your dns ip here>
nmcli con reload "<your connection name here>"

Then, take a look at your ifcfg-x file.
These 3 Users Gave Thanks to Aia For This Post:
jim mcnamara (06-14-2016) rbatte1 (02-20-2017) Skrynesaver (05-19-2016)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Configure resolv.conf and nsswitch.conf flexihopper18 Solaris 1 06-22-2017 08:12 PM
BSD, network manager, resolv.conf, static IP 1in10 IP Networking 0 10-13-2015 01:26 PM
Resolv.conf not getting updated regularly! nixhead Ubuntu 3 07-22-2013 11:53 PM
Issue on resolv.conf Pradipta Kumar Red Hat 3 01-11-2013 02:44 AM
save resolv.conf in linux chuikingman Red Hat 10 06-22-2011 10:50 AM
resolv.conf jld Ubuntu 4 05-08-2010 10:24 AM
resolv.conf and DNS configration ITHelper AIX 13 03-17-2010 10:55 AM
Search directive in resolv.conf tetelee UNIX for Dummies Questions & Answers 4 01-25-2010 08:14 AM
resolv.conf Ex-Capsa UNIX for Dummies Questions & Answers 3 07-03-2009 09:22 AM
Quick question about resolv.conf Keepcase Solaris 5 03-12-2009 08:41 PM
resolv.conf aliahsan81 Shell Programming and Scripting 8 10-14-2008 02:19 AM
resolv.conf & the internet stevie_velvet Solaris 1 08-15-2008 04:26 PM
Suse 10 resolv.conf kjbaumann SuSE 2 07-15-2008 12:45 PM
dns and resolv.conf b03der UNIX for Dummies Questions & Answers 10 07-26-2002 04:34 AM
/etc/resolv.conf rpnhavoc IP Networking 1 02-11-2002 12:04 PM