RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1541031 - NM overwrites resolv.conf when it goes down
Summary: NM overwrites resolv.conf when it goes down
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Beniamino Galvani
QA Contact: Desktop QE
URL:
Whiteboard:
: 1566656 1592102 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-01 14:52 UTC by Vladimir Benes
Modified: 2022-03-13 14:40 UTC (History)
10 users (show)

Fixed In Version: NetworkManager-1.12.0-0.1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:11:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
[PATCH] dns: on quit only update resolv.conf if dns=dnsmasq (1.63 KB, patch)
2018-02-08 17:21 UTC, Beniamino Galvani
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3207 0 None None None 2018-10-30 11:12:20 UTC

Description Vladimir Benes 2018-02-01 14:52:28 UTC
Description of problem:
I have running NM.

I created 00-resolv.conf as follows:

$ cat /etc/NetworkManager/conf.d/00-resolv.conf
[main]
rc-manager=unmanaged

altered /etc/resolv.conf to contain
nameserver 192.168.100.1

and I rebooted thinking that everything will be correctly set on many boxes, so I can update them, etc

but what I see in /etc/resolv.conf?
# Generated by NetworkManager

and that's it. So resolv.conf was overwritten in the meantime. Is this expected? If I call systemctl reload NetworkManager before reboot then everything works well. Do we really want to clean the resolv.conf file when NM goes down? 

Version-Release number of selected component (if applicable):
NetworkManager-1.10.2-9.el7.x86_64

Comment 3 Thomas Haller 2018-02-06 12:58:39 UTC
If you edit NetworkManager.conf files, without reloading the configuration (SIGHUP or via D-Bus), then the changes that you made on disk have no effect until you restart NetworkManager.

Yes, this works as expected. We don't automatically reload configuration (for good reasons), so it's up to the user to do that.


I'd close as NOTABUG.


Regardless of that, I wonder if it ever makes sense to write an empty resolv.conf file. Maybe, if we have no name servers to configure, we should leave whatever currently is in resolv.conf file. However, that would mean, that you cannot un-configure all DNS servers if you wanted to. That doesn't seem right either. Beniamino, what do you think?

Comment 4 Beniamino Galvani 2018-02-08 17:21:43 UTC
Created attachment 1393270 [details]
[PATCH] dns: on quit only update resolv.conf if dns=dnsmasq

Comment 5 Beniamino Galvani 2018-02-08 17:24:09 UTC
(In reply to Thomas Haller from comment #3)
> If you edit NetworkManager.conf files, without reloading the configuration
> (SIGHUP or via D-Bus), then the changes that you made on disk have no effect
> until you restart NetworkManager.
> 
> Yes, this works as expected. We don't automatically reload configuration
> (for good reasons), so it's up to the user to do that.
> 
> 
> I'd close as NOTABUG.
> 
> 
> Regardless of that, I wonder if it ever makes sense to write an empty
> resolv.conf file. Maybe, if we have no name servers to configure, we should
> leave whatever currently is in resolv.conf file. However, that would mean,
> that you cannot un-configure all DNS servers if you wanted to. That doesn't
> seem right either. Beniamino, what do you think?

In my opinion, the problem is that we shouldn't update resolv.conf without reason when quitting. The patch above should fix that.

Comment 6 Thomas Haller 2018-02-08 20:46:16 UTC
(In reply to Beniamino Galvani from comment #4)
> Created attachment 1393270 [details]
> [PATCH] dns: on quit only update resolv.conf if dns=dnsmasq

lgtm

Comment 8 Thomas Haller 2018-04-13 11:56:36 UTC
*** Bug 1566656 has been marked as a duplicate of this bug. ***

Comment 11 Thomas Haller 2018-07-17 11:45:54 UTC
*** Bug 1592102 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2018-10-30 11:11:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3207


Note You need to log in before you can comment on or make changes to this bug.