$ resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: uplink
DNS Servers: 9.9.9.9
Link 2 (enp2s0)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
DNS Servers: 9.9.9.9 149.112.112.112 192.168.0.1
DNS Domain: Home
(With option "use-dns: false" 192.168.0.1 shouldn't be added to the list of DNS servers.)
With "renderer: networkd" it looks alright:
$ resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: uplink
DNS Servers: 9.9.9.9
Link 2 (enp2s0)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
DNS Servers: 9.9.9.9 149.112.112.112
DNS Domain: Home
I can confirm that on an up-to-date Ubuntu 22.04 use-dns doesn't work with the NetworkManager renderer. It does work with networkd.
network: overrides:
ethernets:
enp2s0:
dhcp4: true
dhcp4-
use-dns: false
nameservers:
addresses: [9.9.9.9, 149.112.112.112]
search: []
renderer: NetworkManager
version: 2
$ resolvectl status no/unsupported
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=
resolv.conf mode: uplink
DNS Servers: 9.9.9.9
Link 2 (enp2s0) no/unsupported
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=
DNS Servers: 9.9.9.9 149.112.112.112 192.168.0.1
DNS Domain: Home
(With option "use-dns: false" 192.168.0.1 shouldn't be added to the list of DNS servers.)
With "renderer: networkd" it looks alright:
$ resolvectl status no/unsupported
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=
resolv.conf mode: uplink
DNS Servers: 9.9.9.9
Link 2 (enp2s0) no/unsupported
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=
DNS Servers: 9.9.9.9 149.112.112.112
DNS Domain: Home