systemd-resolve doesn't work

I’m trying to enable mDNS on this device but whenever I run systemd-resolve I get the error sd_bus_open_system: No such file or directory. I can run --help and get the help screen and --version gives me this:

systemd 241 (241)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

However, --status produces the above error, as does --set-mdns. What’s wrong here?

Thanks!

Hi,

by default DietPi is running with limited amount of packages. This include dbus package as well. Therefore it would need to be installed.

apt update
apt install dbus
systemctl enable dbus
reboot

probably systemd-resolved service to be started as well

systemctl enable systemd-resolved.service --force

Ah! That did it. Thank you! :smiley:

Reactivating this thread - I ran into the same problem, want to use systemd-resolved but nothing works. Any hints?

~ # systemctl enable dbus
The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=, Also=, or Alias= settings in the [Install] section, and DefaultInstance= for template units). 
This means they are not meant to be enabled or disabled using systemctl.
Possible reasons for having these kinds of units are:
• A unit may be statically enabled by being symlinked from another unit's  .wants/, .requires/, or .upholds/ directory.
• A unit's purpose may be to act as a helper for some other unit which has  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some  instance name specified.

~ # systemctl enable systemd-resolved.service
Failed to enable unit: Unit systemd-resolved.service does not exist

Well the package is not installed, therefore you can’t enable it. If you need this service, you would need to install the respective package first

apt install systemd-resolved