LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-05-2017, 08:45 PM   #1
pangalactic
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Rep: Reputation: Disabled
Question about Network Manager and immutable resolf.conf. (chattr +i)


So, I was in an interview today, and a question was asked about making the DNS entries persistent even if Network Manager overwrites the resolv.conf file.

I replied you could always make the file immutable after your changes. (Please don't lecture about that NOT being the right way to do it, I'm fully aware...just pointing out possibilities during a discussion.) The engineer who was interviewing me told me that no longer works, as Network Manager can now overwrite them anyway. He was quite adamant about it.

I don't see anywhere where anything has changed about immutable files. I asked if they had a script that checks and reverts it to mutable, and he said no, RH/CentOS does that now.

Is there some flag that NM can be configured to ignore immutable files that I've missed? (FTR, it's been a while since I did any sysadmin work...so I just wanted to make sure I missed something here.)

TIA
 
Old 10-06-2017, 02:09 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
if you want the job you shouldn't start by criticizing the engineer who interviews you.
while he might be technically wrong (idk), i would agree that what you proposed is an inelegant cludge.
i don't use network-manager if i can avoid it, but generally speaking we are talking about dns resolving which is usually done by another utility.
i use systemd nowadays, and i edit /etc/systemd/resolved.conf.
 
Old 10-07-2017, 02:17 AM   #3
pangalactic
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
might be reading into what I said a bit too much...

I didn't criticize the engineer interviewing me at all.

The question was simply how could you do it, and I replied there were several ways (this was specifically in regards to a RHEL/Cent system.) I offered the NetworkManager.conf file first, but he asked what I meant by other ways it could be done, and I rattled off a few. He just was very curt and said that didn't work. He may have been referring to the location having moved in systemd, but he just became very standoffish at that point. I was a little taken aback. Just wondering if there was any more to it than that. (Also, yeah...my first task would be killing NM...)

Last edited by pangalactic; 10-07-2017 at 02:18 AM.
 
Old 10-07-2017, 03:49 AM   #4
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

I have just tested on a CentOS 7 machine.
NetworkManager is unable to modified /etc/resolv.conf after it had been set to immutable.

Last edited by tshikose; 10-08-2017 at 06:41 AM. Reason: chaned typo of /etc/hosts to /etc/resolv.conf
 
1 members found this post helpful.
Old 10-08-2017, 02:43 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ very well, bu we're talking about /etc/resolv.conf, and not /etc/hosts as you originally wrote.

Quote:
Originally Posted by pangalactic View Post
but he asked what I meant by other ways it could be done, and I rattled off a few. He just was very curt and said that didn't work. He may have been referring to the location having moved in systemd, but he just became very standoffish at that point.
sounds like he suddenly realized that his knowledge is not superior to yours in that area?

to come back to the actual question: i don't know either.
resolv.conf might be rewritten by various applications, depending on your setup.
there's even a resolvconf.conf file, duh.
i did the 'chattr +i' cludge some years ago and it worked.
but since i use only systemd to connect to the network, my previously described method is sufficient.
aside: my router can also do dns, so i could point the appropriate config file to an internal ip.

Last edited by ondoho; 10-08-2017 at 09:26 AM. Reason: an explanation seemed necessary after the tshikose edited their post
 
Old 10-08-2017, 04:05 AM   #6
pangalactic
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
No worries...I was just wondering if I had missed an update. I'd be willing to bet that, yeah, they have a script/bypass/solution to prevent it built into their config files (which is probably a smart play, frankly...). Appreciate the response.

J
 
Old 10-08-2017, 06:41 AM   #7
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Quote:
Originally Posted by ondoho View Post
^ very well, bu we're talking about /etc/resolv.conf.
Sorry, my mistake.
I indeed worked on /etc/resolv.conf.
I will update my post above.
 
  


Reply

Tags
immutable, networkmanager



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
use network-manager but set "resolv.conf" manually. hack3rcon Linux - Networking 8 06-25-2015 05:15 AM
[SOLVED] Network Manager & Slack 14.1 Question holden87 Slackware 8 06-16-2014 05:50 AM
[SOLVED] ubuntu 11.04 network manager question kleinde66 Ubuntu 3 09-19-2011 09:58 PM
how to make a network interfaces configuration immutable? jkbrown Linux - Networking 1 03-24-2011 07:39 PM
How can I avoid network manager from modifying resolv.conf? algogeek Linux - Networking 2 05-12-2008 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration