• Debian 13, unknown key 'dns' in /etc/NetworkManager/conf.d/DNS.conf

    From Roger Price@3:633/10 to All on Sunday, March 08, 2026 16:20:01
    I run Debian 13 with the network configuration managed by NetworkManager. I would like to change the DNS server.
    Command dig debian.net currently reports
    ;; SERVER: 10.218.0.1#53(10.218.0.1) (UDP)
    I would like to use 1.1.1.1 as my DNS server so I defined file /etc/NetworkManager/conf.d/DNS.conf
    # Use Cloudfare DNS instead of ISP's DNS
    [ipv4]
    dns=1.1.1.1;1.0.0.1;
    [ipv6]
    dns=2606:4700:4700::1111;2606:4700:4700::1001;
    But command /sbin/NetworkManager --print-config now reports (comments removed)
    [main]
    plugins=ifupdown,keyfile
    configure-and-quit=no
    [ifupdown]
    managed=false
    [ipv4]
    dns=1.1.1.1;1.0.0.1;
    [ipv6]
    dns=2606:4700:4700::1111;2606:4700:4700::1001;
    [logging]
    [device]
    [device-31-mac-addr-change]
    match-device=driver:eagle_sdio,driver:wl
    wifi.scan-rand-mac-address=no
    # WARNING: unknown key 'dns' in section [ipv4] of file '/etc/NetworkManager/conf.d/DNS.conf'
    # WARNING: unknown key 'dns' in section [ipv6] of file '/etc/NetworkManager/conf.d/DNS.conf'
    The key 'dns' is invalid in conf.d . What key should I use ?
    I tried directly modifying the files in /etc/NetworkManager/system-connections/
    using nm-connection-editor following https://wiki.debian.org/NetworkConfiguration#Defining_the_.28DNS.29_Nameservers This works for IPv4, but the WiKi does not explain IPv6 DNS, and nm-connection-editor does not accept cut-and-paste for IPv6 addresses. nm-connection-editor has to be run for every connection. Isn't there some way of making a global change\ufffd?
    Roger


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jeffrey Walton@3:633/10 to All on Sunday, March 08, 2026 16:30:01
    On Sun, Mar 8, 2026 at 11:18?AM Roger Price <roger@rogerprice.org> wrote:
    I run Debian 13 with the network configuration managed by NetworkManager.
    I
    would like to change the DNS server.

    Command dig debian.net currently reports

    ;; SERVER: 10.218.0.1#53(10.218.0.1) (UDP)

    I would like to use 1.1.1.1 as my DNS server so I defined file /etc/NetworkManager/conf.d/DNS.conf

    # Use Cloudfare DNS instead of ISP's DNS
    [ipv4]
    dns=1.1.1.1;1.0.0.1;
    [ipv6]
    dns=2606:4700:4700::1111;2606:4700:4700::1001;

    But command /sbin/NetworkManager --print-config now reports (comments removed)

    [main]
    plugins=ifupdown,keyfile
    configure-and-quit=no

    [ifupdown]
    managed=false

    [ipv4]
    dns=1.1.1.1;1.0.0.1;

    [ipv6]
    dns=2606:4700:4700::1111;2606:4700:4700::1001;

    [logging]
    [device]
    [device-31-mac-addr-change]
    match-device=driver:eagle_sdio,driver:wl
    wifi.scan-rand-mac-address=no

    # WARNING: unknown key 'dns' in section [ipv4] of file '/etc/NetworkManager/conf.d/DNS.conf'
    # WARNING: unknown key 'dns' in section [ipv6] of file '/etc/NetworkManager/conf.d/DNS.conf'

    The key 'dns' is invalid in conf.d . What key should I use ?

    According to Google:
    In networkd files, DNS= should typically reside under
    the [Network] section, not [IPv4].

    I tried directly modifying the files in /etc/NetworkManager/system-connections/
    using nm-connection-editor following

    https://wiki.debian.org/NetworkConfiguration#Defining_the_.28DNS.29_Nameservers

    This works for IPv4, but the WiKi does not explain IPv6 DNS, and nm-connection-editor does not accept cut-and-paste for IPv6 addresses.

    nm-connection-editor has to be run for every connection. Isn't there some way
    of making a global change ?

    Jeff


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Roger Price@3:633/10 to All on Sunday, March 08, 2026 17:20:01
    Subject: Re: Debian 13, unknown key 'dns' in /etc/NetworkManager/conf.d/DNS.conf

    On Sun, 8 Mar 2026, Jeffrey Walton wrote:
    According to Google:

    ? ? In networkd files, DNS= should typically reside under
    ? ? the [Network] section, not [IPv4].
    In this Debian 13 machine?:
    root@maria ~ ps -ef | grep -i network
    root 873 1 0 2025 ? 00:23:30 /usr/sbin/NetworkManager --no-daemon
    There is no networkd. By default Debian 13 does not seem to use systemd-networkd?.
    Roger


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andy Smith@3:633/10 to All on Sunday, March 08, 2026 17:30:02
    Subject: Re: Debian 13, unknown key 'dns' in /etc/NetworkManager/conf.d/DNS.conf

    Hi,

    On Sun, Mar 08, 2026 at 03:55:32PM +0100, Roger Price wrote:
    I would like to use 1.1.1.1 as my DNS server so I defined file /etc/NetworkManager/conf.d/DNS.conf

    https://wiki.archlinux.org/title/NetworkManager#Custom_DNS_servers

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lee@3:633/10 to All on Sunday, March 08, 2026 23:30:01
    On Sun, Mar 8, 2026 at 2:43?PM Andy Smith <andy@strugglers.net> wro
    te:

    Hi,

    On Sun, Mar 08, 2026 at 03:55:32PM +0100, Roger Price wrote:
    I would like to use 1.1.1.1 as my DNS server so I defined file /etc/NetworkManager/conf.d/DNS.conf

    https://wiki.archlinux.org/title/NetworkManager#Custom_DNS_servers

    Is the Debian wiki not applicable here?

    https://wiki.debian.org/resolv.conf#Stop_dhclient_from_modifying_.2Fetc.2Fr esolv.conf

    I configure /etc/resolv.conf the way I want it and it stays that way :)
    if it makes a difference.. I don't configure any of the DNS stuff in
    network manager.

    Regards
    Lee

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andy Smith@3:633/10 to All on Sunday, March 08, 2026 23:40:02
    Subject: Re: Debian 13, unknown key 'dns' in /etc/NetworkManager/conf.d/DNS.conf

    Hi,

    On Sun, Mar 08, 2026 at 06:19:39PM -0400, Lee wrote:
    I don't configure any of the DNS stuff in network manager.

    Neither do I. I'm just pointing to an answer for the question posed.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Roger Price@3:633/10 to All on Tuesday, March 10, 2026 13:40:01
    Subject: Re: Debian 13, unknown key 'dns' in /etc/NetworkManager/conf.d/DNS.conf

    On Sun, 8 Mar 2026, Andy Smith wrote:
    On Sun, Mar 08, 2026 at 03:55:32PM +0100, Roger Price wrote:
    I would like to use 1.1.1.1 as my DNS server so I defined file /etc/NetworkManager/conf.d/DNS.conf

    https://wiki.archlinux.org/title/NetworkManager#Custom_DNS_servers
    Thanks for the URL. Clause 4.7.3.1 Unmanaged /etc/resolv.conf looks like what I
    need. I defined file /etc/NetworkManager/conf.d/DNS.conf as\ufffd:
    # Prevent NetworkManager from changing /etc/resolv.conf
    [main]
    dns=none
    I defined /etc/resolv.conf as
    # Use Cloudfare DNS instead of ISP's DNS
    nameserver 1.1.1.1
    nameserver 1.0.0.1
    nameserver 2606:4700:4700::1111
    nameserver 2606:4700:4700::1001

    I restarted NetworkManager and command NetworkManager --print-script now reports
    [main]
    dns=none
    The file /etc/resolv.conf has not been modified. This is a complete solution to
    my problem. :-)
    I read the Debian Wiki. Essentially, this says "use nm-connection-editor". The
    disadvantages of nm-connection-editor are\ufffd:
    1. Every connection profile in /etc/NetworkManager/system-connections/ has to be
    treated seperately. There is no global solution.
    2. The technique covers IPv4 only, not IPv6.
    So I will stick with the ArchLinux clause 4.7.3.1 Unmanaged /etc/resolv.conf solution. Thanks to everyone who responded.
    Roger


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Greg Wooledge@3:633/10 to All on Tuesday, March 10, 2026 14:10:01
    Subject: Re: Debian 13, unknown key 'dns' in /etc/NetworkManager/conf.d/DNS.conf

    On Tue, Mar 10, 2026 at 13:16:32 +0100, Roger Price wrote:
    Thanks for the URL. Clause 4.7.3.1 Unmanaged /etc/resolv.conf looks like what I
    need. I defined file /etc/NetworkManager/conf.d/DNS.conf as?:

    # Prevent NetworkManager from changing /etc/resolv.conf
    [main]
    dns=none

    I defined /etc/resolv.conf as

    # Use Cloudfare DNS instead of ISP's DNS
    nameserver 1.1.1.1
    nameserver 1.0.0.1
    nameserver 2606:4700:4700::1111
    nameserver 2606:4700:4700::1001

    I restarted NetworkManager and command NetworkManager --print-script now reports

    [main]
    dns=none

    The file /etc/resolv.conf has not been modified. This is a complete solution to
    my problem. :-)

    I read the Debian Wiki. Essentially, this says "use nm-connection-editor".
    [...]

    I've added the alternative solution to the wiki page. Thank you for
    letting us know about it.

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jeffrey Walton@3:633/10 to All on Tuesday, March 10, 2026 14:30:02
    On Tue, Mar 10, 2026 at 9:03?AM Greg Wooledge <greg@wooledge.org> wrote:
    On Tue, Mar 10, 2026 at 13:16:32 +0100, Roger Price wrote:
    Thanks for the URL. Clause 4.7.3.1 Unmanaged /etc/resolv.conf looks
    like what I
    need. I defined file /etc/NetworkManager/conf.d/DNS.conf as :

    # Prevent NetworkManager from changing /etc/resolv.conf
    [main]
    dns=none

    I defined /etc/resolv.conf as

    # Use Cloudfare DNS instead of ISP's DNS
    nameserver 1.1.1.1
    nameserver 1.0.0.1
    nameserver 2606:4700:4700::1111
    nameserver 2606:4700:4700::1001

    I restarted NetworkManager and command NetworkManager --print-script now
    reports

    [main]
    dns=none

    The file /etc/resolv.conf has not been modified. This is a complete
    solution to
    my problem. :-)

    I read the Debian Wiki. Essentially, this says "use
    nm-connection-editor".
    [...]

    I've added the alternative solution to the wiki page. Thank you for
    letting us know about it.

    ++.


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