Bug 1303095 - NetworkManager restart removes nameservers from resolv.conf
NetworkManager restart removes nameservers from resolv.conf
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
23
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Lubomir Rintel
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-29 09:30 EST by Oleg Fayans
Modified: 2016-12-20 13:17 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 13:17:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Oleg Fayans 2016-01-29 09:30:40 EST
Description of problem:

When I configure NetworkManager to NOT update resolv.conf and then reset it's configuration to initial and restart it, it removes all configured nameservers in resolv.conf.

Version-Release number of selected component (if applicable):

NetworkManager-1.0.10-2.fc23.x86_64

How reproducible:
Always

Steps to Reproduce:
1. create a file named 20-unmanaged-resolv.conf in /etc/NetworkManager/conf.d/ folder with the following contents:
[main]
dns=none
2. restart NetworkManager
3. make sure /etc/resolv.conf contains at least one nameserver directive
4. remove /etc/NetworkManager/conf.d/20-unmanaged-resolv.conf file
5. restart NetworkManager
6. Inspect /etc/resolv.conf

Actual results:

all lines starting with 'nameserver' get deleted

Expected results:

File should remain unchanged

Additional info:
Tried it on f22 with NetworkManager-1.0.2-1.fc22.x86_64 - works as expected.
Comment 1 Beniamino Galvani 2016-02-16 04:11:39 EST
(In reply to Oleg Fayans from comment #0)
> Description of problem:
> 
> When I configure NetworkManager to NOT update resolv.conf and then reset
> it's configuration to initial and restart it, it removes all configured
> nameservers in resolv.conf.

At first sight this looks correct; when NM restarts the dns=none is not present and therefore NM actively manages resolv.conf. Probably there aren't any active connections and therefore the file gets cleared.

Can you please describe why do you think that NM should not touch resolv.conf after the restart?

And also, can't you simply leave dns=none if you care about resolv.conf not being overwritten?
Comment 2 Oleg Fayans 2016-04-20 03:41:27 EDT
> At first sight this looks correct; when NM restarts the dns=none is not present > and therefore NM actively manages resolv.conf. Probably there aren't any active > connections and therefore the file gets cleared.

The thing occurs in virtual machines running in rhevm lab. It is highly unlikely that at any given period of time they have no network connection. 

I do not think, NM should not touch resolv.conf after restart, I am just sure it should put SOME nameservers there.

This whole workflow disabling NM interaction with the resolver was a part of an automated test. Naturally, all changes to the target system are reverted at the test teardown. It's the next test, failing due to empty resolv.conf, that actually made us consider NM's behavior inappropriate.
Comment 3 Beniamino Galvani 2016-04-20 06:21:23 EDT
(In reply to Oleg Fayans from comment #2)
> I do not think, NM should not touch resolv.conf after restart, I am just
> sure it should put SOME nameservers there.

You are right, NM should put some servers in resolv.conf, as long as
there are active connections providing those name servers. Can you please
show the output of 'nmcli c; nmcli d' before and after the restart
(when resolv.conf is empty)? Thanks!
Comment 4 Fedora End Of Life 2016-11-24 10:16:11 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 6 Fedora End Of Life 2016-12-20 13:17:44 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

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