To change the hostname on a Solaris system:
1. Change the hostname in /etc/nodename. Replace the information in this file; commenting out the previous value will cause problems during a reboot.
2. Run uname -S new_hostname to
change the nodename and hostname for your current session.
3. Change the hostname in /etc/hostname.network_interface (e.g., /etc/hostname.hme0). Replace the information in this file; commenting out the previous value will cause problems during a reboot.
4. Change the hostname in /etc/hosts
5. Change the hostname in /etc/net/*/hosts (/etc/net/ticlts/hosts, /etc/net/ticots/hosts, /etc/net/ticotsord/hosts), if applicable. More information on these files is available here.
# for FILE in `find /etc/net -name hosts` ; do
> fgrep -l old_hostname $FILE > /dev/null 2>&1 && sed 's/old_hostname/new_hostname/g' $FILE > $FILE.new && mv $FILE.new $FILE
> done
7. Change the hostname in /etc/inet/ipnodes (Solaris 10 or later)
I recommend rebooting the system after making the above changes. Services may perform unexpectedly after a "live" hostname change.More information:
http://www.princeton.edu/~unix/Solaris/troubleshoot/hostname-change.html
Back to brandonhutchinson.com.