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 ?
According to Google:In this Debian 13 machine?:
? ? In networkd files, DNS= should typically reside under
? ? the [Network] section, not [IPv4].
I would like to use 1.1.1.1 as my DNS server so I defined file /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
I don't configure any of the DNS stuff in network manager.
On Sun, Mar 08, 2026 at 03:55:32PM +0100, Roger Price wrote:Thanks for the URL. Clause 4.7.3.1 Unmanaged /etc/resolv.conf looks like what I
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?:
# 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".
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 lookslike 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 nowreports
[main]
dns=none
The file /etc/resolv.conf has not been modified. This is a completesolution to
my problem. :-)
I read the Debian Wiki. Essentially, this says "usenm-connection-editor".
[...]
I've added the alternative solution to the wiki page. Thank you for
letting us know about it.
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 119:49:19 |
| Calls: | 125 |
| Calls today: | 125 |
| Files: | 489 |
| D/L today: |
859 files (365M bytes) |
| Messages: | 76,568 |
| Posted today: | 26 |