Thursday, February 14, 2013

How to change hostname in Solaris 11?

Purpose:: To change a Solaris 11 system's hostname from "sol11" to "solaris11"
root@sol11:~# hostname
sol11
Checking hostname related configuration:
root@sol11:~# svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/loopback             astring
config/nodename             astring     sol11
Actual process of changing hostname:
root@sol11:~# svccfg -s system/identity:node setprop config/nodename = astring: solaris11
root@sol11:~# svccfg -s system/identity:node setprop config/loopback = astring: solaris11

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

root@sol11:~# svccfg -s system/identity:node refresh
root@sol11:~# svcadm restart system/identity:node
Check the hostname now:
root@sol11:~# hostname
solaris11
Whenever get a chance, reboot the server:
root@sol11:~# reboot

No comments: