I’ve never used network manager before, and right now I have a need to change the DNS settings on a system of mine that just so happens to be using it. Let’s look at the commands to change the DNS servers using network manager.
To modify the DNS server settings, we’ll want to call the network manager CLI modify connection and input the DNS settings we want to change. For the terminal, this becomes “nmcli con mod”. We then give it the connection name, “ipv4.dns” argument, and a list of the DNS servers to set. The full command can be seen below.
nmcli con mod $connectionName ipv4.dns "8.8.8.8 8.8.4.4"
connectionName
can be found by command: nmcli con
. In the question case, it will be "System eth0"
as always, after configuration changes, restart the service
As always, after configuration changes, restart the service
service NetworkManager restart
Now we should have our new DNS servers active for our network configuration.