by systemtest · 7y ago · 0 comments
Networkmanager defines a "connection" for every (stored) wifi, which you can view:
nmcli connection show
Now, you can set the dns servers to use when any of these connections is activated. For instance, define google's servers by: nmcli conn mod <connection-name> ipv4.dns "8.8.8.8 8.8.4.4"
This will override the DNS settings (which come from DHCP by default) whenever you connect to this specific network :)Getting NetworkManager to work properly was a matter of disabling all that systemd stuff and then setting it up using config files and nmcli (the gnome GUI just broke everything too easily).
My impression after all that was that NetworkManager is a very capable piece of software littered with bad interfaces and impenetrable documentation. You will emerge victorious if you fight those hard enough. In contrast, trying to setup the system using the various systemd-thingies got me to "xxx is planned but not working now" every time.
Btw, I do have a weird complicated network configuration because I'm switching between ethernet and wifi, and have multiple bridged and/or routed vms/containers (with all of kvm, lxc, and virtualbox).