0

I'd like to start using systemd-resolved on Oracle Linux 7.6.

I'd like to use it in the mode where /etc/resolv.conf is just a symlink to /run/systemd/resolve/stub-resolv.conf having just nameserver 127.0.0.53 as a content.

I've installed systemd-networkd and systemd-resolved packages. I've enabled the relevant services and I've disabled NetworkManager and network services.

However my installation of systemd-resolved doesn't contain this stub file /run/systemd/resolve/stub-resolv.conf. It contains just /run/systemd/resolve/resolv.conf.

Could you please advise why is my stub-resolv.conf missing?

2 Answers2

1

I'm observing the same issue on Debian 9. According to (man 8 systemd-resolved.service):

 o   A static file /usr/lib/systemd/resolv.conf is provided that lists the 127.0.0.53 DNS stub (see above) as only DNS server. This file may be symlinked from /etc/resolv.conf in order to connect all local clients that bypass local DNS APIs to systemd-resolved. This mode of operation is recommended.

This is not true actually the file is under: /lib/systemd/resolv.conf And this is a plain static file, pointing to local stub server, no search domains and etc.

If you upgrade to Debian 10 version of systemd-resolved moves from 232 to 241. This enables the correct stub file: /run/systemd/resolve/stub-resolv.conf

I guess you are using similar systemd-resolved version as on Debian 9. Check your man and locate your resolv.conf files using find.

tio78
  • 11
  • 1
1

I faced the same issue on Ubuntu 20.04 LTS many times and it's just because of the systemd-resolved.service which was either stopped automatically or deliberately. After starting the service the file /run/systemd/resolv/stub-resolv.conf file is back.