Failed to start systemd-resolved.service . systemd-resolved.service: Failed with result 'resources'. [1]: Failed to start Network Name Resolution

5,785

I am a novice contributor. Would like suggetions to improve the answer !!

Although a lot of errors are raised by #systemctl status systemd-resolved.service The main issue was resources.

This issue was caused by the absence of tmp directory in var

i.e. /var/tmp/ was absent.

Solution:

mkdir /var/tmp
chmod 777 /var/tmp

777 permission is a bad practice for webservers as it gives read/write access to every user. So please use it accordingly

Then to start the service, I performed:

systemctl enable --now systemd-resolved.service

Then, ping google.com gives successful result.

Solution was inspired from https://www.raspberrypi.org/forums/viewtopic.php?t=249619

PS: For other errors:

May 19 11:15:15 kv-server systemd[1]: systemd-resolved.service: Service has no hold-off time, scheduling restart.
May 19 11:15:15 kv-server systemd[1]: systemd-resolved.service: Scheduled restart job, restart counter is at 5.

You can view https://serverfault.com/a/1032451

For good resources on systemd-resolved name resolution view:

https://www.youtube.com/watch?v=DtFjrJdnWAU

https://moss.sh/name-resolution-issue-systemd-resolved/

https://unix.stackexchange.com/questions/328131/how-to-troubleshoot-dns-with-systemd-resolved

Share:
5,785

Related videos on Youtube

Kaustubh Shete
Author by

Kaustubh Shete

Eager to learn and Eager to Help !! Engineering Undergrad with a focus in DeepLearning Data Science & MLOps. Little Experience in Linux and IoT Systems.

Updated on September 18, 2022

Comments

  • Kaustubh Shete
    Kaustubh Shete over 1 year

    Main Issue is:

    # systemctl status systemd-resolved.service
    
    systemd-resolved.service -
    Network Name Resolution Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
    Active: failed (Result: resources) since Wed 2021-05-19 11:15:15 UTC; 23s ago
    Docs: man:systemd-resolved.service(8)
    https://www.freedesktop.org/wiki/Software/systemd/resolved
    https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
    https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
    
    May 19 11:15:15 kv-server systemd[1]: systemd-resolved.service: Service has no hold-off time, scheduling restart.
    May 19 11:15:15 kv-server systemd[1]: systemd-resolved.service: Scheduled restart job, restart counter is at 5.
    May 19 11:15:15 kv-server systemd[1]: Stopped Network Name Resolution.
    May 19 11:15:15 kv-server systemd[1]: systemd-resolved.service: Start request repeated too quickly.
    May 19 11:15:15 kv-server systemd[1]: systemd-resolved.service: Failed with result 'resources'.
    May 19 11:15:15 kv-server systemd[1]: Failed to start Network Name Resolution.
    

    This issue was something which I landed up by doing the below steps:

    apt-get update was failing. I started by following the answer of https://askubuntu.com/a/91590/1042537

    This explained the issue and pointed fault towards DNS.

    To configure dns servers, I followed https://stackoverflow.com/a/54460886/14950576 .

    I also did # chattr +i /etc/resolv.conf so that resolv.conf doesn't get updated by DHCP

    I tried # ping google.com but it still failed.

    I observed a bad symlink /etc/resolv.conf -> /run/systemd/resolve/stub-resolve.conf So I tried to access /run/systemd/resolve/stub-resolve.conf

    Got an error that there is no directory /run/systemd/resolve

    So I followed https://unix.stackexchange.com/a/613143 and got to know that systemd-resolved.service was not running.

    Error I got was

    # systemctl enable --now systemd-resolved.service
    Job for systemd-resolved.service failed because of unavailable resources or another system error.
    See "systemctl status systemd-resolved.service" and "journalctl -xe" for details.
    

    As I tried to do start that, I ran into the main issue.

    So Network Name Resolution is unable to start.