DNS randomly stops working, have to manually restart resolved service

Like title says, I am randomly having problems with DNS on one of my computers. I don’t know what log I am going to have to copy when it acts up again, but it restores just fine when I restart resolved service. I think it has something to do with Tailscale. I disabled the service and I haven’t had a problem yet.

I’ll post if it pops up again, I just need to know what related log I need to upload here with it. Thanks.

Which resolver you have in use?
I’m guessing at this point, but it might help if you show us the output of:
pacman -Qs resolv
pacman -Qo resolvconf
resolvectl status
systemctl status systemd-resolved

 2  ⌘ ✘  pacman -Qs resolv                                                                                                                                                   17h10m49s  ~ 
local/libmicrodns 0.2.0-2
    Minimal mDNS resolver library
local/ruby 3.3.5-2
    An object-oriented language for quick and easy programming
local/systemd-resolvconf 257.1-1
    systemd resolvconf replacement (for use with systemd-resolved)
local/unbound 1.22.0-2
    Validating, recursive, and caching DNS resolver
 3  ⌘ ✔  pacman -Qo resolvconf                                                                                                                                                           ~ 
/usr/bin/resolvconf is owned by systemd-resolvconf 257.1-1
 4  ⌘ ✔  resolvectl status                                                                                                                                                               ~ 
Global
           Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: foreign
  Current DNS Server: 8.8.8.8#dns.google
Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2620:fe::9#dns.quad9.net 2001:4860:4860::8888#dns.google

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

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

Link 5 (br10)
    Current Scopes: LLMNR/IPv4 LLMNR/IPv6 mDNS/IPv4 mDNS/IPv6
         Protocols: -DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
     Default Route: no

Link 7 (wlan1)
    Current Scopes: none
         Protocols: -DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
     Default Route: no
 5  ⌘ ✔  systemctl status systemd-resolved                                                                                                                                               ~ 
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; disabled; preset: enabled)
     Active: active (running) since Tue 2024-12-24 22:59:23 CST; 17h ago
 Invocation: e10fb0a96c994acc87edca7b48420e61
       Docs: man:systemd-resolved.service(8)
             man:org.freedesktop.resolve1(5)
             https://systemd.io/WRITING_NETWORK_CONFIGURATION_MANAGERS
             https://systemd.io/WRITING_RESOLVER_CLIENTS
   Main PID: 3434336 (systemd-resolve)
     Status: "Processing requests..."
      Tasks: 1 (limit: 9384)
     Memory: 2.5M (peak: 4.2M, swap: 2.1M, swap peak: 2.1M, zswap: 564K)
        CPU: 3.424s
     CGroup: /system.slice/systemd-resolved.service
             └─3434336 /usr/lib/systemd/systemd-resolved

Dec 24 22:59:23 Desktop-Endeavour systemd-resolved[3434336]: Positive Trust Anchors:
Dec 24 22:59:23 Desktop-Endeavour systemd-resolved[3434336]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Dec 24 22:59:23 Desktop-Endeavour systemd-resolved[3434336]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arp>
Dec 24 22:59:23 Desktop-Endeavour systemd-resolved[3434336]: Using system hostname 'Desktop-Endeavour'.
Dec 24 22:59:23 Desktop-Endeavour systemd-resolved[3434336]: mDNS-IPv4: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding tran>
Dec 24 22:59:23 Desktop-Endeavour systemd-resolved[3434336]: mDNS-IPv6: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding tran>
Dec 24 22:59:40 Desktop-Endeavour systemd-resolved[3434336]: Switching to fallback DNS server 1.1.1.1#cloudflare-dns.com.
 6  ⌘ ✘                                                                                                                    

It appears that your system is using systemd-resolved in “foreign mode” as name resolver.
Have you set it up that way? And why in “foreign” mode, it is not the recommended way (stub mode)?
Read here in the arch wiki.

Also, there is a second resolver installed on your system, unbound. Did you deliberatly installed this package? Any of the below “required by” or “optional for” packages installed ?


pacman -Sii unbound                                                                                                                  ✔
Repository      : extra
Name            : unbound
Version         : 1.22.0-2
Description     : Validating, recursive, and caching DNS resolver
Architecture    : x86_64
URL             : https://unbound.net/
Licenses        : BSD-3-Clause
Groups          : None
Provides        : libunbound.so=8-64
Depends On      : dnssec-anchors  fstrm  glibc  hiredis  ldns  libnghttp2  libsodium  libevent  libevent-2.1.so=7-64  openssl  libcrypto.so=3-64
libssl.so=3-64  protobuf-c  libprotobuf-c.so=1-64  systemd-libs  libsystemd.so=0-64
Optional Deps   : expat: for unbound-anchor
sh: for unbound-control-setup
python: for python-bindings
Required By     : getdns  libreswan  lokinet  monero  monero-gui
Optional For    : dnf  prometheus-unbound-exporter
Conflicts With  : None
Replaces        : None
Download Size   : 1081.89 KiB
Installed Size  : 4167.80 KiB
Packager        : Jelle van der Waa <jelle@archlinux.org>
Build Date      : Mon Nov 18 18:46:57 2024
MD5 Sum         : 1b8713a9a4b63f3198362ff3a64e5c90
SHA-256 Sum     : 8133692b3d9d8fc869e0e3caef829a4f5e5de0e0d5f3393621cc327e46d2c40c
Signatures      : C06086337C50773E
Extended Data   : None

What exactly you do here? systemctl restart systemd-resolved?

It says “disabled” in one place, is that still the same after performing systemctl enable --now systemd-resolved?

In summary:

  1. To use systemd-resolved in “foreign” mode is not the recommended way.
  2. There shouldn’t be a second resolver installed, unbound, unless you know what you are doing. Read through unbound documentation.
  3. Systemd-resolved is “disabled” in one place, it should be enabled.

I personally have no experience, neither with “foreign mode” nor with “unbound”. I recommend to reduce complexity of your “resolver system”

Most likely. :wink:

Well, I haven’t had a problem with the system since I uninstalled tailscale. Not sure what is up with “foreign mode”, could be due to tailscale or something else. This was mostly a default install as far as the network goes.

I have used unbound before with a pi-hole setup, but not on here. I think it might have been setup when I installed tailscale and set up this device to broadcast as an exit node. I guess I will have to reinstall tailscale later and see if it borks my system again. No need really thought because I just tailscale into my server which is broadcasting my network which in turn I can just ssh into anything on the subnet.