How to set ipv4.dns-search persistently with NetworkManager

Solution Verified - Updated -


  • We require use of the search option in /etc/resolv.conf. We use Azure, and it does not allow search to be configured, only nameserver. Azure sets a default search field, which we'd like to override.
# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
  • We are using NetworkManager to set dns-search by running command nmcli con mod eno1 ipv4.dns-search "", which works in runtime, but it is not persistent.
  • Need a persistent way to change/override default search parameter in /etc/resolv.conf


  • Red Hat Enterprise Linux (RHEL) 9
  • Red Hat Enterprise Linux (RHEL) 8
  • Red Hat Enterprise Linux (RHEL) 7
  • NetworkManager

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content