1

Network Manager is posting the correct name servers and search domains into /etc/resolv.conf when I restart the network. However, it is not in an order I like. How can I tell Network Manager to prioritize the nameservers and search domain information of a certain interface over another?

Example:

What I get:

# cat /etc/resolv.conf 
# Generated by NetworkManager
search silatria.org relinq.org pripylen.org acarime.org
nameserver 120.052.0.2
nameserver 120.052.0.1
nameserver 10.66.66.1 

What I want

# Generated by NetworkManager
search acarime.org silatria.org relinq.org pripylen.org 
nameserver 10.66.66.1  
nameserver 120.052.0.2
nameserver 120.052.0.1

acarime.org & nameserver 10.66.66.1 belongs to my network interface enp3s0 120.052.0.2.1, 120.052.0.1 & silatria.org relinq.org pripylen.org belongs to my network interface enp4s0

  • It would be nice to have the version of rhel / rpm -q NetworkManager here, e.g. just in case there's a feature for it but it was added later. – sourcejedi Sep 27 '18 at 23:13
2

Set ipv4.dns-priority of at least one of the profiles, to specify the relative order.

For example

nmcli connection modify "$PROFILE" ipv4.dns-priority 5

and reactivate the connection.

See the manual nm-settings for details.

  • Thanks, this worked! – PolkaRon Mar 20 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.