When Solaris 11 was released more configurations were moved into the service management framework, and moved out of configuration files, one of these changes was the hostname/nodename.
View Hostname in SMF
This will read back the configuration out of the SMF.
svccfg -s system/identity:node listprop config
config application
config/nodename astring solaris11box
config/loopback astring solaris11boxChange Hostname in SMF
We have two separate settings, which need to be updated.
svccfg -s system/identity:node setprop config/nodename = astring: newname
svccfg -s system/identity:node setprop config/loopback = astring: newnameReview the Changes
svccfg -s system/identity:node listprop config
config application
config/nodename astring newname
config/loopback astring newnameRestart the Service to Reflect Changes
The system is now aware of the change, however it doesn’t use the change until the next reboot. We can accelerate this by restarting the system/identity:node service.
svccfg -s system/identity:node refresh
svcadm restart system/identity:nodeThis will then show a system message reflecting the new hostname, to see the change in your shell prompt, you can spin off a child bash shell. You can also use the hostname command to view the current hostname.
UPDATEDecember 30, 2012
Included an update based on Mark’s comment below to account for the refresh which needs to take place.