Skip to content

systemd-resolved sometimes stops resolving #21123

Open

Description

@gudvinr

systemd version the issue has been seen with

systemd 249 (249.5-2-arch)

Used distribution

Arch Linux

Linux kernel version used (uname -a)

5.14.14-arch1-1 #1 SMP PREEMPT Wed, 20 Oct 2021 21:35:18 +0000 x86_64 GNU/Linux

CPU architecture issue was seen on

x86_64

Expected behaviour you didn't see

Resolving domains in custom TLD from local DNS server.

Unexpected behaviour you saw

Not resolving said domains

Steps to reproduce the problem

  1. Add domains to static DNS records on the router (MikroTik hAP ac²)
  2. DHCP pushes DNS server address to PC with systemd-resolved enabled
  3. NetworkManager receives DNS address and adds it to systemd-resolved
  4. systemd-resolved correctly resolves static DNS records for a while
  5. Observe errors when resolving domains

I do not see errors or any logs at the time of me noticing these issues. It just stops resolving and last log messages for systemd-resolved.service are about it being started when I boot PC.

Additional program output to the terminal or log subsystem illustrating the issue

$ resolvectl status
Global
           Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: stub
  Current DNS Server: 9.9.9.9#dns.quad9.net
         DNS Servers: 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net
Fallback DNS Servers: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google

Link 2 (enp5s0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 3 (eno1)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 4 (wlp6s0)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.0.1
       DNS Servers: 192.168.0.1

Link 5 (docker0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

$ resolvectl query network-device.mytld
network-device.mytld: resolve call failed: 'network-device.mytld' not found
$ resolvectl -i wlp6s0 query network-device.mytld
network-device.mytld: resolve call failed: 'network-device.mytld' not found

$ drill @192.168.0.1 network-device.mytld
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 32879
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 
;; QUESTION SECTION:
;; network-device.mytld.   IN      A

;; ANSWER SECTION:
network-device.mytld.      3600    IN      A       192.168.0.2

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 1 msec
;; SERVER: 192.168.0.1
;; WHEN: Mon Oct 25 22:26:18 2021
;; MSG SIZE  rcvd: 51

$ resolvectl flush-caches 
$ resolvectl query network-device.mytld
network-device.mytld: 192.168.0.2                -- link: wlp6s0

Configuration

$ cat /etc/systemd/resolved.conf.d/dns.conf
[Resolve]
DNS=2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net
FallbackDNS=8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
DNSSEC=no
DNSOverTLS=no
MulticastDNS=no
LLMNR=no
Cache=yes
$ cat /etc/NetworkManager/conf.d/dns.conf 
[main]
dns=systemd-resolved

Activity

  1. poettering commented on Oct 26, 2021

    @poettering
    Member

    please enable debug logging for resolved, then reproduce the issue and provide the generated log output of resolved here. i.e. systemctl service-log-level systemd-resolved debug and then to collect the logs do journalctl -e -u systemd-resolved

  2. added
    needs-reporter-feedback ❓
    on Oct 26, 2021
  3. gudvinr commented on Oct 26, 2021

    @gudvinr
    Author

    systemctl service-log-level systemd-resolved debug

    Will this configuration persist after system/daemon restart or do I have to run it manually every time after boot?

  4. poettering commented on Oct 26, 2021

    @poettering
    Member

    that command line only has an effect until resolved exits/is restarted.

    You can make the change persistently. Type "systemctl edit systemd-resolved", then enter:

    [Service]
    Environment=SYSTEMD_LOG_LEVEL=debug
    

    Then save and restart resolved.

  5. gudvinr commented on Oct 26, 2021

    @gudvinr
    Author

    @poettering I was able to reproduce error. Can I send logs via more private channel (email maybe?) because there are quite sensitive data.

  6. rfried-nrl commented on Oct 29, 2021

    @rfried-nrl

    I experience the same, I can also try to reproduce with more logs.
    I added the environment variable above, where should I see the logs ? I don't see anything added to journalctl rather then the default stuff systemd-resolved spew.

  7. gudvinr commented on Oct 29, 2021

    @gudvinr
    Author

    @rfried-nrl you should see it in journalctl -u systemd-resolved (also you could add -f to see it live or -e to skip) but don't forget to run systemctl daemon-reload and systemctl restart systemd-resolved

  8. rfried-nrl commented on Oct 31, 2021

    @rfried-nrl

    @gudvinr I think I understood the problem I had.
    For some reason our DHCP server offered 3 DNS, two in AWS and 8.8.8.8 as the third one.
    It appears that sometimes because of timeout or something like that, the systemd-resolve cycled to 8.8.8.8 and that's why local domains stopped being resolved.
    I removed the 8.8.8.8 from the DHCP and looks like it's working now.

    I see that you declared 8.8.8.8 as fallback on your setup. when it occurs, can you paste the output of systemd-resolved --status ?

  9. gudvinr commented on Oct 31, 2021

    @gudvinr
    Author

    For some reason our DHCP server offered 3 DNS, two in AWS and 8.8.8.8 as the third one.
    It appears that sometimes because of timeout or something like that, the systemd-resolve cycled to 8.8.8.8 and that's why local domains stopped being resolved.
    I removed the 8.8.8.8 from the DHCP and looks like it's working now.

    In my case DHCP server only advertises itself (as seen from resolvectl status there's only 192.168.0.1 on wlp6s0)

  10. gudvinr commented on Nov 1, 2021

    @gudvinr
    Author

    Right now I don't have any resolvers except the one from DHCP:

    Global
           Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: stub
    
    Link 2 (enp5s0)
    Current Scopes: none
         Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    
    Link 3 (eno1)
    Current Scopes: none
         Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    
    Link 4 (wlp6s0)
        Current Scopes: DNS
             Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    Current DNS Server: 192.168.0.1
           DNS Servers: 192.168.0.1
    
    Link 5 (docker0)
    Current Scopes: none
         Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    

    And local domains are not resolving while I can browse websites as usual.

    Logs from some time ago show this:

    Nov 01 09:34:49 systemd-resolved[772628]: Removing cache entry for hostname.domain IN A (expired 1s ago)
    Nov 01 09:34:55 systemd-resolved[772628]: idn2_lookup_u8: hostname.domain → hostname.domain
    Nov 01 09:34:55 systemd-resolved[772628]: Looking up RR for hostname.domain IN A.
    Nov 01 09:34:55 systemd-resolved[772628]: Looking up RR for hostname.domain IN AAAA.
    Nov 01 09:34:55 systemd-resolved[772628]: varlink-17: Sending message: {"error":"io.systemd.Resolve.DNSError","parameters":{"rcode":3}}
    

    At some point cache entry expired and resolved never tried to get it again returning error every time after that

  11. gudvinr commented on Nov 3, 2021

    @gudvinr
    Author

    I'd say this is really disturbing. Last day I flushed caches manually 5 times or so

  12. Drc-DEV commented on Nov 15, 2021

    @Drc-DEV

    Disabling systemd-resolved and switching to dnsmasq solves the issue for me.

  13. ronalde commented on Jan 27, 2022

    @ronalde

    Same here. A year ago, and now again. I tried to follow the diagnose instructions here and in an older closely related issue; this one seems a Duplicate of #12142. but gave up again. I ran resolved on an arch desktop, wireless connected to a hotspot (ie. as a DHCP client), with dnsmasq binded to the (static configured) wired interface, which serves as both dhcp and (caching/forwarding) dns server for wired hosts connected to the same switch/segment.

  14. gudvinr commented on Feb 18, 2022

    @gudvinr
    Author

    This bug finally started to be annoying enough to ditch resolved for dnsmasq. No sudden issues with DNS ever since.

  15. 100 remaining items

  16. laur89 commented on Sep 17, 2025

    @laur89

    Has anyone seen recent degradation in this domain resolution issue? Running 258~rc4-1 on debian testing and past week or so it's gotten so bad the experience gets borderline unusable. Have network-manager 1.54.0-4 installed, but as I understand it's not yet confirmed whether it's part of the puzzle or not.

  17. micressor commented on Sep 18, 2025

    @micressor

    I am still experiencing this issue with systemd-resolved version 257.8-1~deb13u2 on Debian 13.
    Note: NetworkManager is not in use in this setup.
    I suspect the issue might be related to globally configured DNS-over-TLS (DoT) servers.
    When I configure regular (non-DoT) DNS servers at the link interface level, the problem does not occur.

  18. zopieux commented on Oct 6, 2025

    @zopieux

    Had a similar issue today after updating a (NixOS) system to newer software releases. The symptom is that resolved, with DNS-over-TLS enabled, suddenly stopped answering queries with a nondescript error (I sadly lost my terminal history, but it was around the line of “could not get an answer from any of the servers” / “could not connect” printed by resolvectl query <anything>. debug-level logs were not showing anything relevant. nsswitch-routed DNS lookups (i.e. all glibc software) would time out.

    Restarting systemd-resolved solved it. This machine isn't running NetworkManager.

    Update: this is actually happening reproducibly after “a while”: resolved stops being able to resolve, but immediately works if systemctl restart'ed. Next time this happens I'll try to extract logs and add them here.

  19. lgourdin commented on Oct 17, 2025

    @lgourdin

    I have this bug too, as described in the previous comment. Weirdly, among several Debian 13 machines using the exact same network stack (systemd-netword + resolved with DHCPv4+v6) and same nsswitch.conf, only one of them has the bug.
    I extracted the debug logs while trying to resolve a domain name, but the logs are not really helpful here:

    Oct 17 10:27:20 systemd-resolved[426]: Cache miss for google.com IN AAAA
    Oct 17 10:27:20 systemd-resolved[426]: Firing regular transaction 58431 for <google.com IN AAAA> scope dns on */* (validate=yes).
    Oct 17 10:27:20 systemd-resolved[426]: Using feature level TLS+EDNS0 for transaction 58431.
    Oct 17 10:27:20 systemd-resolved[426]: Using DNS server 149.112.112.112#dns.quad9.net for transaction 58431.
    Oct 17 10:27:20 systemd-resolved[426]: Sending query via TCP since UDP isn't supported or DNS-over-TLS is selected.
    Oct 17 10:27:20 systemd-resolved[426]: Using feature level TLS+EDNS0 for transaction 58431.
    Oct 17 10:27:20 systemd-resolved[426]: Announcing packet size 1252 in egress EDNS(0) packet.
    Oct 17 10:27:20 systemd-resolved[426]: Switching to system DNS server 2620:fe::fe#dns.quad9.net.
    Oct 17 10:27:20 systemd-resolved[426]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/resolve1 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=7065 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
    Oct 17 10:27:20 systemd-resolved[426]: Regular transaction 58431 for <google.com IN AAAA> on scope dns on */* now complete with <attempts-max-reached> from none (unsigned; non-confidential).
    Oct 17 10:27:20 systemd-resolved[426]: Freeing transaction 58431.
    

    It retries many times the operation (from the "cache miss" line to the "Sent message" result), and eventually fails and logs the last two lines.

    This bug seems to be open for a long time and honestly it seems critical. Running resolved in production is maybe still very ambitious today...

    EDIT: as the previous comment says, it's happening after a while and disappears after restarting.

  20. N4taaa commented on Oct 19, 2025

    @N4taaa

    Not sure if this adds much to the issue, but maybe some future time travelers will find use in this, as this was the first issue I encountered on the matter. ;]

    The issue myself (and maybe others) have been encountering seems to be #38509, which was caused by a regression that has since been solved in 257.9 (#38509). I also had this issue with NixOS while running systemd 257.8, but updating the package seems to have fixed it, as I have used it for around a week now without re-encountering the issue.

    Hope it helps someone out there! Upgrading system packages is a good idea regardless (in most cases…) :]

  21. lgourdin commented on Oct 20, 2025

    @lgourdin

    Yep I saw the regression too, but version 257.9 is not yet available on Debian trixie. I hope this was the problem and upgrading will fix it (and that debian maintainers will offer the new version soon)!
    thanks for your answer!

  22. Arbel-arad commented on Oct 21, 2025

    @Arbel-arad

    Not sure if this adds much to the issue, but maybe some future time travelers will find use in this, as this was the first issue I encountered on the matter. ;]

    The issue myself (and maybe others) have been encountering seems to be #38509, which was caused by a regression that has since been solved in 257.9 (#38509). I also had this issue with NixOS while running systemd 257.8, but updating the package seems to have fixed it, as I have used it for around a week now without re-encountering the issue.

    Hope it helps someone out there! Upgrading system packages is a good idea regardless (in most cases…) :]

    I was seeing the same thing, also on nixos + systemd 257.8 and fixed on .9
    the random nature of this issue makes it a lot more difficult to find, this time it only showed up on my laptop but not servers (which had it last time)

  23. TheCodeAbode commented on Nov 4, 2025

    @TheCodeAbode

    The problem is still there on 257.10 on Fedora 42. I'm not using NetworkManager.

  24. zopieux commented on Nov 5, 2025

    @zopieux

    I can confirm that this zombification issue only exists between nixpkgs commits:

    NixOS/nixpkgs@c80f6a7 (March, good)
    becomes bad at some point between March & October 2
    NixOS/nixpkgs@7df7ff7 (October, bad)
    is resolved at some point between October 2 & October 21
    NixOS/nixpkgs@5e2a59a (October, good again)

    That's unfortunately a substantial amount of time, and bisecting is not doable since this is not easily reproducible beyond “waiting for hours/days until resolving starts to timeout". Mapping commits to systemd versions is left as an exercise to the reader.

  25. StCyr commented on Dec 17, 2025

    @StCyr

    faced this issue this morning after an update of my ovh cloud server.

    Adding FallbackDNS=213.186.33.99 (ip address found in /etc/network/interfaces.d/50-cloud-init) to my /etc/systemd/resolved.conf file solved the issue.

    Note sure if my spamassassin service still benefits from local dns cache though

    FTR here's the content of my /etc/network/interfaces.d/50-cloud-init file:

    # This file is generated from information provided by the datasource.  Changes
    # to it will not persist across an instance reboot.  To disable cloud-init's
    # network configuration capabilities, write a file
    # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
    # network: {config: disabled}
    auto lo
    iface lo inet loopback
        dns-nameservers 213.186.33.99
    
    auto eth0
    iface eth0 inet dhcp
        mtu 1500
    
  26. lgourdin commented on Dec 17, 2025

    @lgourdin

    For me the bug is resolved since upgrade 257.9-1~deb13u1 on Debian 13.
    It never occurred on any of my Debian 12 servers.

  27. xnox commented on Feb 2, 2026

    @xnox
    Contributor

    The original bug report was without dns over tls.
    Recent discussions is about regressions & fixes for dns over tls.
    It is unfortunate that various users experience bugs/regressions/fixes on a different timeline due to different major/minor versions, and the differences in velocity of upgrades.

    I will try to work on a specific resolved bug report template, such that we can capture accurately issues; and see if we need to fix things; or to request various distributions to upgrade/fix things.

    how does everyone here feel about closing this bug report and/or like splitting it into individual issues to the tune of "$distro version between versions A and B, are affected by C" and similar more granular issues?

  28. Arvyr commented on May 4, 2026

    @Arvyr

    I don't know if this is still under investigation, but I got this issue too. At some random time, systemd-resolved stops resolving and a restart temporarily solves the issue.
    It also doesn't happen do every system, but those that are plagued by this, have it occur quite frequently, about once or twice a week.
    I'm using AlmaLinux 10 (systemd 257.13.el10.alma.1) and Debian 13 (systemd 257.9-1~deb13u1) on Proxmox 9 with Technitium DNS (14.3) as DNS servers (using DoT/DNSSEC).

    I also tried the unstable repo on Debian 13 (systemd-260.1-1) with no luck.

    My dns config is as follows:

    [Resolve]
    DNS=10.33.0.153#exn1mgtsdnsv002.mgt.exn.lan 10.33.0.53#exn1mgtsdnsv001.mgt.exn.lan fddd:330::153#exn1mgtsdnsv002.mgt.exn.lan fddd:330::53#exn1mgtsdnsv001.mgt.exn.lan
    FallbackDNS=
    DNSSEC=yes
    DNSOverTLS=yes
    DNSStubListener=yes
    DNSStubListenerExtra=::1
    Domains=mgt.exn.lan
    MulticastDNS=no
    

    I also collected debug data (1,7GB) but there doesn't seem to be anything relevant in it.
    Only options left for me at this point are to downgrade DoT to opportunistic/no or refrain from using the stub resolver altogether.

  29. laur89 commented on May 4, 2026

    @laur89

    I also tried the unstable repo on Debian 13 (systemd-260.1-1) with no luck.

    Anecdotal, but am on debian testing (currently also using same systemd ver 260.1-1) and haven't come across this issue in ~half a year; at least it hasn't affected me in a way that's obvious.

  30. Arvyr commented on Jun 15, 2026

    @Arvyr

    So after continuously running into this issue I think I finally kinda found the issue here.
    Under Debian I set up all relevant networking configuration parameters under /etc/network/interfaces.d/.conf including dns-nameservers and dns-search. For some reason that randomly kept interfering with systemd-resolved.

    I removed these lines, restarted networking and systemd-resolved and now it seems stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs-reporter-feedback ❓resolve

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions