Solaris 11 – changing the hostname

Changing the hostname in Solaris 11.x

1. To check the current environment properties:

root@Ferdy-Sol11:~# svccfg -s system/identity:node listprop config
config                       application        
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     Ferdy-Sol11
config/loopback             astring     Ferdy-Sol11

 

2. Set the new hostname.
Example from Ferdy-Sol11 to FerdyS11

root@Ferdy-Sol11:~# svccfg -s system/identity:node setprop config/nodename="FerdyS11"
root@Ferdy-Sol11:~# svccfg -s system/identity:node setprop config/loopback="FerdyS11"

 

3. Refresh the properties:

root@Ferdy-Sol11:~# svccfg -s system/identity:node refresh

 

4. Restart the service:

root@Ferdy-Sol11:~# svcadm restart system/identity:node

 

5. Verify:

root@Ferdy-Sol11:~# svccfg -s system/identity:node listprop config
config                       application        
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     FerdyS11
config/loopback             astring     FerdyS11

root@Ferdy-Sol11:~# hostname
FerdyS11

The new hostname in the prompt will appear the next time a shell is open.