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.
NetworkManager resolv.conf search string
Re: NetworkManager resolv.conf search string
Does ipv4.dns-priority affect the order?
Re: NetworkManager resolv.conf search string
no that doesn't impact the search string order.
I have been looking into putting a script in dispatcher.d directory to do the same function the enter-hooks script was doing but it appears network Manager executes these scripts before it updates the resolv.conf because I'm ending up with a search string as follows search subdomian.domain.com domain.com subdomain.domain.com My script changes the search string to search subdomian.domain.com domain.com Then network manager is appending another subdomain.domain.com. My script is looking for the action "connectivity-change". I've had the same result when using the action "up" as well.
I have been looking into putting a script in dispatcher.d directory to do the same function the enter-hooks script was doing but it appears network Manager executes these scripts before it updates the resolv.conf because I'm ending up with a search string as follows search subdomian.domain.com domain.com subdomain.domain.com My script changes the search string to search subdomian.domain.com domain.com Then network manager is appending another subdomain.domain.com. My script is looking for the action "connectivity-change". I've had the same result when using the action "up" as well.