I'm trying to modify NetworkManager's default DNS settings so that whenever I add a new connection it uses 127.0.0.1
instead of the default DNS for that connection. I still would like to be able to modify the DNS for each individual connections afterwards however.
I set up DNSCrypt recently, and it worked great on most networks. However, some networks that I use require that I use their DNS server instead of DNSCrypt, meaning that I cannot simply set the default nameserver on resolv.conf
to 127.0.0.1
. I found that NetworkManager/nmcli still did a good job of using DNSCrypt when I changed some of the networks to use 127.0.0.1
. However, it would be very nice if each new connection had this config by default:
/etc/NetworkManager/system-connections/connection.conf
[ipv4]
dns=127.0.0.1;
ignore-auto-dns=true
method=auto
In my research I found this in the NetworkConfig.conf
manpage:
Specify default values for connections.
Example:
[connection]
ipv6.ip6-privacy=0
However, there are only a few supported properties, and trying this did not work:
[connection]
ipv4.method=auto
ipv4.dns=127.0.0.1;
ipv4.ignore-auto-dns=true
I was wondering if there were any know workarounds to this issue, either using NetworkManager or something different.
/etc/systemd/network/
files and restart both services. I continue using NetworkManager and systemd takes care of the DNS (tested withsystemd-resolve --status
).