LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   CentOS 8.2 how to set Primary DNS/Secondary DNS without connection (https://www.linuxquestions.org/questions/centos-111/centos-8-2-how-to-set-primary-dns-secondary-dns-without-connection-4175684469/)

tpirapokin 10-30-2020 02:37 PM

CentOS 8.2 how to set Primary DNS/Secondary DNS without connection
 
I want to set DNS1/DNS2 for the system and not per nic. Is it possible with NetworkManager? All the example I see is
nmcli con mod <connectionName> ipv4.dns "8.8.8.8 8.8.4.4"

berndbausch 10-30-2020 07:09 PM

nmcli doesn't define nameservers per NIC, but per connection. A given NIC can have more than one connection associated with it. This becomes important e.g. when you have a laptop that needs different nameservers at home, in the office and on the road.

nmcli enters nameservers in /etc/resolv.conf, which is a global configuration file. That file contains all nameservers from all active connections (to be honest, I don't know what happens if more than three nameservers are defined). Their ordering depends on priorities as documented at https://access.redhat.com/documentat...ing-networking.


All times are GMT -5. The time now is 02:29 PM.