Bug 1921057 - RFE: let systemd-resolved take over /etc/resolv.conf automatically and restore previous setting when stopped
Summary: RFE: let systemd-resolved take over /etc/resolv.conf automatically and restor...
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-27 13:14 UTC by Petr Menšík
Modified: 2021-05-15 20:18 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-15 20:18:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Menšík 2021-01-27 13:14:15 UTC
Description of problem:
Because systemd-resolved is enabled by default, it took over /etc/resol.conf. It should pass management of the file back to NetworkManager and fill it with working nameservers.

Version-Release number of selected component (if applicable):
systemd-246.6-3.fc33.x86_64

How reproducible:
always

Steps to Reproduce:
1. Install fedora33
2. systemctl stop systemd-resolved
3. ping -4 -c 3 fedoraproject.org

Actual results:
ping: fedoraproject.org: Temporary failure in name resolution


Expected results:
PING  (8.43.85.73) 56(84) bytes of data.
64 bytes from proxy03.fedoraproject.org (8.43.85.73): icmp_seq=1 ttl=50 time=13.7 ms
64 bytes from proxy03.fedoraproject.org (8.43.85.73): icmp_seq=2 ttl=50 time=13.6 ms
64 bytes from proxy03.fedoraproject.org (8.43.85.73): icmp_seq=3 ttl=50 time=13.8 ms


Additional info:
There seems to be prepared file just for this use: /run/NetworkManager/resolv.conf
I think systemd-resolved should take over /etc/resolv.conf symlink when it starts (and is configured to do so) and release it to whatever state before startup, which should still provide working resolution.

systemctl disable --now systemd-resolved should keep the system fully operational.

Comment 1 Ben Cotton 2021-02-09 15:43:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Zbigniew Jędrzejewski-Szmek 2021-05-15 20:18:41 UTC
I guess this could be done in principle, but the downsides are bigger than the potential advantages.
systemd-resolved is running sandboxed. So we would need to either give more permissions to it (which
we certainly don't want to do), or set up a helper service. But the use case seems too fringe to do that.
Right now the expectation is that if name resolution is configured automatically by the distro. If
a user wants to set some different configuration, they have to make various decisions and set a few
different things appropriately. Alternative setups and other tinkering are of course OK, but then the
promise of a working setup out of the box doesn't apply. So yeah, I can symphatize with the request to some
extent, I don't think this is something we would ever want to support.


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