• Re: systemd-resolved ignoring /etc/resolv.conf custom nameservers afte

    From didier gaumet@3:633/10 to All on Thursday, March 05, 2026 10:50:01
    Subject: Re: systemd-resolved ignoring /etc/resolv.conf custom nameservers after Bookworm upgrade

    Le 05/03/2026 … 03:47, Vahid Shaik a ‚crit˙:
    Hi all,

    Hello,

    Please take into consideration that I am far from competent for anything network related.

    [...]
    1. Setting DNS= and FallbackDNS= in /etc/systemd/resolved.conf ? works temporarily but reverts after reboot on one of my machines

    ArchLinux Wiki advise to create a /etc/systemd/resolved.conf.d/dns_servers.conf file to indicate custom DNSes: https://wiki.archlinux.org/title/Systemd-resolved#Manually

    2. Symlinking /etc/resolv.conf to /run/systemd/resolve/resolv.conf ?
    gives me the "upstream" servers but breaks .local resolution

    From what I understand (wrongly?), that the other way around: "[...]systemd-resolved maintains the /run/systemd/resolve/resolv.conf
    file for compatibility with traditional Linux programs. This file may be symlinked from /etc/resolv.conf and is always kept up-to-date,
    containing information about all known DNS servers.[...]" https://www.freedesktop.org/software/systemd/man/latest/systemd-resolved.service.html#/etc/resolv.conf

    3. Disabling systemd-resolved entirely ? works but feels like fighting
    the system

    Why? I don't know why but there seem to be a general misconception that systemd-resolved is the default for headless machines in the Debian
    ecosystem.
    Paragraph 5.2.4 of Bookworm Release Notes states: "[...]Note that systemd-resolved was not, and still is not, the default DNS resolver in Debian[...]" https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#systemd-resolved

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jan Claeys@3:633/10 to All on Thursday, March 05, 2026 17:40:01
    Subject: Re: systemd-resolved ignoring /etc/resolv.conf custom nameservers after Bookworm upgrade

    On Thu, 2026-03-05 at 01:58 +0000, Vahid Shaik wrote:
    1. Setting DNS= and FallbackDNS= in /etc/systemd/resolved.conf ?
    ?
    works temporarily but reverts after reboot on one of my machines

    You have to find out what "reverts" it & how (was that config
    overwritten or ignored?).

    And when systemd-resolved is managing resolv.conf, you have to make
    sure nothing else is trying to do the same.

    2. Symlinking /etc/resolv.conf to /run/systemd/resolve/resolv.conf ?
    ?
    gives me the "upstream" servers but breaks .local resolution

    Assuming by .local you mean Multicast DNS (mDNS), then systemd-resolved
    can handle that or not, depending on the MulticastDNS setting in /etc/systemd/resolve.conf (if disabled there, you'll need nss-mdns to
    resolve .local names through mDNS). Of course, if your .local host
    names are regular DNS entries in Pi-hole (not a good idea), then you'll probably have to disable mDNS entirely.

    3. Disabling systemd-resolved entirely ? works but feels like
    fighting the system

    For those who've dealt with this ? what's the recommended Debian
    way
    to handle custom DNS with systemd-resolved? Should I stick with
    resolved and configure it properly, or is disabling it and managing resolv.conf manually still a valid approach on Bookworm?

    Both options should still work.

    The systemd-resolved.service(8) manpage documents how systemd-resolved interacts with /etc/resolv.conf, so that's the best place to start.

    Also, whatever manages your network connection might be trying to set
    custom DNS server for that connection, e.g. provided by DHCP or NM
    static configuration or VPN setup. When using systemd-resolved, the
    command 'resolvectl status' will show the global & per-link DNS servers systemd-resolved is using. Per-link (=connection) settings override
    global ones.



    --
    Jan Claeys

    (please don't CC me when replying to the list)

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jan Claeys@3:633/10 to All on Thursday, March 05, 2026 17:50:02
    Subject: Re: systemd-resolved ignoring /etc/resolv.conf custom nameservers after? Bookworm upgrade

    On Wed, 2026-03-04 at 22:43 -0500, Robert Heller wrote:
    If systemd-resolved is installed and running, you completely lose
    control of /etc/resolv.conf -- editing /etc/resolv.conf is not
    effectual at all.

    That's not (entirely) true, systemd-resolved can work with resolv.conf
    as explained in the systemd-resolved.service(8) manpage under the '/ETC/RESOLV.CONF' header.


    --
    Jan Claeys

    (please don't CC me when replying to the list)

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)