Total Pageviews

Monday, 2 February 2015

Hostname Change in Solaris 10 & 11 !!!

In Solaris 10, we all know how to change hostname of server without reboot.
It is so simple, just to edit entry of hostname in few files.

/etc/nodename 
/etc/hostname.*interface 
/etc/inet/hosts or /etc/hosts
/etc/inet/ipnodes 

Then we need to take care regarding crashdump location. Usually we use default location for crash dump location as /var/crash/"hostname". So rename the directory in this location:

# cd /var/crash
# mv oldname newname

Coming to Solaris 11, modifications need to be done in system configuration can be achieved through single command " svccfg ". By Centralizing such management simplifies Configuration and Administration.

Few example like,

# svccfg -s svc:/system/environment:init --- we can modify environmental values like Timezone.

then >setprop TZ=Asia/Calcutta.

Similarly to change hostname, we have svccfg -s svc:/system/identity:node rather than editing individual files like /etc/nodename for hostname and /etc/default/init for Timezone.

To change hostname in Solaris 11 follow these steps :

svccfg -s system/identity:node setprop config/nodename="MyProdServer"

svccfg -s system/identity:node setprop config/loopback="MyProdServer"

svccfg -s system/identity:node refresh

svcadm restart system/identity:node

As shown above, in identity:node service need to change 2 properties " nodename and loopback ". After setting properties just take a restart of the service to reflect modifications.

Take a new session and observe the change in hostname.

################################################################################

No comments:

Post a Comment