"No DNS servers known" in /run/systemd/resolve/resolv.conf

Bug #1956447 reported by Pavel Derendyaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
New
Undecided
Unassigned

Bug Description

1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04

2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center
systemd:
  Installed: 245.4-4ubuntu3.13
  Candidate: 245.4-4ubuntu3.13

3) What you expected to happen

/etc/network/interfaces:

auto lo
iface lo inet loopback
    dns-nameservers 1.1.1.1 8.8.8.8

auto eth0
iface eth0 inet static
    address ip/24
    mtu 1500
    post-up route add default gw gw_ip || true
    pre-down route del default gw gw_ip || true

When system rebooted I expected in

/run/resolvconf/resolv.conf:
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 127.0.0.53

and in /run/systemd/resolve/resolv.conf:
nameserver 1.1.1.1
nameserver 8.8.8.8

This is stated in "man 8 systemd-resolved":
systemd-resolved maintains the /run/systemd/resolve/resolv.conf file for compatibility with traditional Linux programs

4) What happened instead

/run/systemd/resolve/resolv.conf:
# No DNS servers known.

But after restarting systemd-resolved it update this file correctly.

5) Also

The system behaves correctly when DHCP is used. So when in /etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

Then /run/systemd/resolve/resolv.conf updated correctly straight without restart.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.