Wednesday, November 12, 2014

How to change hostname in Solaris11

As all we know, there are lot of changes in Solaris11. To change the hostname aka node name in Solaris11 we have to modify the SMF properties as they eliminated most of the file base update.

Here are the steps to change hostname aka nodename in Solaris11.

Check the current properties value:
root@clnode1:~# 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     clnode1
root@clnode1:~# 
Set / Change Hostname :
root@clnode1:~# svccfg -s system/identity:node setprop config/nodename=node2
root@clnode1:~# svccfg -s system/identity:node setprop config/loopback=node2
root@clnode1:~#
Refresh the properties and restart the service to take effect:
root@clnode1:~# svccfg -s system/identity:node refresh
root@clnode1:~# svcadm restart system/identity:node
root@clnode1:~# 
Update the /etc/hosts file and verify the changes:
root@clnode1:~# svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     node2
config/loopback             astring     node2
root@clnode1:~# hostname
node2
root@node1:~# cat /etc/hosts | grep -i 192.168.10.12 
192.168.10.12 node2
root@clnode1:~#
Cool.. Completed our task successfully.

0 comments:

Post a Comment