It doesn't work.
The nameserver used in the lab still have no priority over the ISP ones that are automatically added to /etc/resolv.conf first.
The only way to do this is to disable /etc/resolv.conf update by NetworkManager and switch either to Wicked and modify the interface file for each dns server in the wanted order; OR modify the /etc/sysconfig/network/config Directive NETCONFIG_DNS_POLICY= to "STATIC" AND furnish the static DNS list with the directive NETCONFIG_DNS_STATIC_SERVERS= with the DNS in your wanted order.
The issue is: with this kind of settings NetworkManager is no more usable as the different profile's DNS list are not added to /etc/resolv.conf.
I can't understand why NetworkManager can not be configured as Wicked interface.
DNS1= mydns DNS2= ispdns1 DNS3= ispdns2
I did not found any directive telling the ISP dns servers to be added at the end of the list instead of the top...
What I did after read again the documentation: for a laptop there is two files to be modified:
- /etc/dhclient.conf
- /etc/NetworkManager/NetworkManager.conf
First looking at dhclient.conf you have to be sure to uncomment those two lines:
- prepend domain-name-servers <Your DNS here or 127.0.0.1>;
- require subnet-mask, domain-name-servers;
If you are using a particular DNS (in my case I handle my own zone with a DNS) you have to write something like
prepend domain-name-servers 192.168.0.3;
If not, default is
prepend domain-name-servers 127.0.0.1;
Second, looking at NetworkManager.conf you have to write something like this:
[main] plugins=keyfile dns=default rc-manager=file dhcp=dhclient [connectivity] uri=http://conncheck.opensuse.org [ifupdown] managed=true
...and never forget to commit
systemctl restart NetworkManager
...and more /etc/resolv.conf to see if it has worked as expected ^^
rasalgethi:/etc/NetworkManager # more /etc/resolv.conf # Generated by NetworkManager search dezordi.world nameserver 192.168.0.3 nameserver 62.197.111.140 nameserver 109.88.203.3
These settings could also be relevant for workstations, but they are less likely to be moved from physical networks to others.
rpm -q NetworkManagerhere, e.g. just in case there's a feature for it but it was added later.