RHEL 8 NetworkManager resolv.conf search string

Latest response

I need to be able to dynamicly append a search domain to the search string in /etc/resolv.conf. In prior versions I was able to to do this with a dhclient-enter-hooks script. but with NetwrokManager taking control in 8 this no longer functions. I cant figure out how to duplicate the functionality in NetwrokManager.

I have a number of machines that will get the hostname of
host.subdomain.domain.com.

NetworkManager will properly put subdomain.domain.com as the search string.

search subdomain.domain.com

But I also need to have it append dmoain.com to the search string as well if the machine is in a subdomian.

search subdomain.domain.com domain.com

using nmcli con mod ens192 ipv4.dns-search "domain.com" will cause it to be pre-pended to the search string which will not work for me. I need it to be appended.

Also this image will be deployed to a mix of physical and virtual machines so I cannot rely on the interface being consistent. the change also has to survive patching and updating of packages. the way a dhclient-enter-hooks script would.

Responses