Now, when I restart the connection Method is back on “Automatic”, and a quick check online shows that I am using the ISP’s default DNS instead of the new ones. I have also foolishly tried editing resolv.conf, before I realised that gets overwritten every time NetworkManager starts. What am I getting wrong?
Also, I understand that even if I manage to make it work, this would only be valid for a single connection. Is there a way to set my DNS for every connection?
Show the actual connection definition from the /etc/NetworkManager/system-connections/. Show /etc/resolv.conf. Show how exactly you
No. The simplest way is to not try to outsmart NetworkManager but leave it at default settings which will use netconfig and configure netconfig to use static addresses and ignore information from NetworkManager.
# Generated by NetworkManager
search lan
nameserver ----CUSTOM ipv4 DNS IP 1----
nameserver ----CUSTOM ipv4 DNS IP 2----
nameserver 192.168.00.10
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver ----CUSTOM ipv6 DNS IP 1----
nameserver ----CUSTOM ipv6 DNS IP 2----
and as for restarting the connection I mean switching the wifi off and on again
That’s why I initially set the method in the connection to “Manual”.
But for some reason the “Manual” option is not persistent, and as soon as the connection is restarted it turns back on “Automatic”.
How can I set it to be persistent? nmconnection is a read-only file, and it gets rewritten at every connection start as well
I have done that, but for some reason the DNS choice gets overridden. @arvidjaar noted above that for my NetworkManager setup to work as intended I should have in the configuration ipv4.ignore-auto-dns, which I suppose is the same to set the method to “Manual”, but this reverts to auto every time
I have no idea what you were doing. You did not even name the frontend you used to configure NetworkManager so set method to “Manual” does not really mean anything.
Show the initial connection profile. Do your configuration changes. Before doing anything else show this connection profile again. Did it change? Now do something that results in “DNS choice gets overridden”. Show the connection profile again. Are there any changes?
But I ask myself, if you always want to use the same DNS servers anyway, why do you insist on NetworkManager managing your /etc/resolv.conf to start with? Why not tell NetworkManager to not touch /etc/resolv.conf and simply enter there the DNS servers you need “for every connection”?