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 :

   # 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 :

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

Reply via email to