This is what I want to do, I have a script to check and add the new search DNS domain in /etc/resolv.conf, however I am trying to develop the script to do all of the below:
Check hostname, if using FQDN change to correct DNS name
check /etc/resolv.conf and remove old DNS search and nameservers, then put new nameservers in file.
check /etc/hosts, and remove old DNS domain name and put in new DNS domain name to server name.
check /etc/sysconfig/network, put full server name with new DNS appended to server short name.
check /etc/sysconfig/network-scripts/ifcfg-eth#, remove old DNS statements and put new in file.
service network restart