Solaris Hostname Changing

Here is the step by step procedure to change/rename hostname on Solaris 11. In Solaris 10 all we know that we need to edit few files in order to change the hostname, but in Solaris 11 we need to change the hostname in SMF service level. Let we can start doing that.

Checking the SMF Services
root@hans-karri_SOL11:~# svcs -a|grep -i node
online 21:53:28 svc:/system/identity:node
root@hans-karri_SOL11:~#

Checking the current property settings 
root@hans-karri_SOL11:~# svccfg -s system/identity:node
svc:/system/identity:node> listprop config
config application
config/enable_mapping boolean true
config/ignore_dhcp_hostname boolean true
config/nodename astring hans-karri_SOL11
config/loopback astring hans-karri_SOL11
svc:/system/identity:node>

Change/Rename the hostname entries 
root@hans-karri_SOL11:~# svccfg -s system/identity:node
svc:/system/identity:node>
svc:/system/identity:node> setprop config/nodename=Hostname1
svc:/system/identity:node> setprop config/loopback=Hostname1
svc:/system/identity:node>

Verifying the changes 
root@hans-karri_SOL11:~# svccfg -s system/identity:node
svc:/system/identity:node> listprop config
config application
config/enable_mapping boolean true
config/ignore_dhcp_hostname boolean true
config/nodename astring Hostname1
config/loopback astring Hostname1
svc:/system/identity:node>

Restart the service to take effect the changes 
root@hans-karri_SOL11:~# svccfg -s system/identity:node refresh
root@hans-karri_SOL11:~# svcadm restart system/identity:node
root@hans-karri_SOL11:~# svccfg -s system/identity:node listprop config
config application
config/enable_mapping boolean true
config/ignore_dhcp_hostname boolean true
config/nodename astring Hostname1
config/loopback astring Hostname1
root@hans-karri_SOL11:~# hostname
Hostanme1
root@hans-karri_SOL11:~#