Skip to content
Search AlmaLinux

    Browse this documentation

    AlmaLinux 10: three listeners on port 53 and who answers what

    An AlmaLinux 10.2 Server VM with systemd-resolved-257-23.el10_2.1.alma.1 and dnsmasq-2.90.

    This host is both the LAN resolver (dnsmasq on 192.168.2.241:53) and a system with systemd-resolved as its local entry point. Screenshot: public/evidence/resolved/alma-coexist.png.

    $ ss -lunp | grep ':53 '
    UNCONN 0 0 127.0.0.54:53 ... systemd-resolve
    UNCONN 0 0 127.0.0.53%lo:53 ... systemd-resolve
    UNCONN 0 0 192.168.2.241:53 ... dnsmasq
    • 127.0.0.53: the resolved stub local applications use;
    • 127.0.0.54: resolved’s proxy/DoT listener (enabled by default);
    • 192.168.2.241:53: dnsmasq serving the LAN.

    They bind different addresses, so they coexist. The real clash is two daemons both binding 0.0.0.0:53 — which normally happens when bind-interfaces is missing.

    Pointing one domain back at the local dnsmasq

    Section titled “Pointing one domain back at the local dnsmasq”
    $ resolvectl dns ens18 192.168.2.241
    $ resolvectl domain ens18 '~lab.test'
    $ resolvectl query web.lab.test
    web.lab.test: 192.168.2.241 -- link: ens18

    Note the upstream is 192.168.2.241, not 127.0.0.1: dnsmasq is bound to that address only, so 127.0.0.1 yields Connection refused — the first mistake we made here.

    $ resolvectl status ens18
    Link 2 (ens18)
    Current Scopes: DNS
    Protocols: +DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    Current DNS Server: 192.168.2.241
    DNS Servers: 192.168.2.241
    DNS Domain: ~lab.test
    FieldMeaning
    Current Scopes: DNSthe link takes part in DNS routing
    Current DNS Serverthe server actually used
    DNS Domain: ~lab.testwith ~ it is a routing domain
    DNSSEC=no/unsupportedvalidation currently off

    With resolved installed, /etc/resolv.conf is usually a symlink to /run/systemd/resolve/stub-resolv.conf. Consequences:

    • editing it does not change resolved’s behaviour and is overwritten;
    • change the link configuration instead (resolvectl or nmcli);
    • to bypass resolved entirely, disable it or have applications talk to a specific server.
    • Using 127.0.0.1 as upstream: the stub owns that port and dnsmasq is elsewhere;
    • Treating the stub as “the real DNS”: it is a local proxy; answers still come from upstream;
    • Two sources of truth: when both nmcli and resolvectl set DNS, the connection’s configuration wins on activation;
    • Concluding it is broken because dig @127.0.0.53 fails: the stub is not a general-purpose server; use resolvectl query.
    Terminal window
    resolvectl status ens18 | sed -n '1,10p'
    ss -lunp | grep ':53 '
    resolvectl query web.lab.test
    sudo resolvectl flush-caches
    resolvectl statistics | head -6

    Checks:

    1. Which listener belongs to which process;
    2. Whether DNS Domain carries the ~;
    3. Whether answers are tagged -- link: ens18;
    4. That flush-caches resets the cache counters.

    常见问题

    Must I choose between resolved and dnsmasq?

    No. resolved can be the local entry point while dnsmasq serves the LAN, as long as they bind different addresses.

    How do I enable DNSSEC?

    Set DNSSEC=yes (or allow-downgrade) in resolved.conf, then check the validation state in resolvectl query output.

    Why is /etc/resolv.conf a symlink?

    resolved took it over; that is expected and hand edits are overwritten at the next start.