Solaris 11 set hostname

In Solaris 11 you will need few steps in order to set server hostname.

Check what was the current hostname
$ svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     abc
config/loopback             astring     abc

Set new hostname
$ svccfg -s system/identity:node setprop config/nodename="emp1"

Refresh and restart the system/identity:node service
$ svcadm refresh system/identity:node
$ svcadm restart system/identity:node

Verify changes
$ svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     emp1
config/loopback             astring     emp1

$ hostname
emp1

Add in hosts file too
root@conoemp1 # cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
10.10.10.1    emp1 emp1.com


No comments: