Changing the hostname and IP in Solaris 10

All changes must be done as root.

To change the hostname of a Solaris 10 system it's necessary to edit 4 files.

/etc/hosts
In this file there is an entry like this:
# Internet host table
#
::1 localhost
127.0.0.1 localhost
[ip address] [hostname] loghost
Change the last line to:
[ip address] [new hostname] loghost
If required to change the host ip change it here.

/etc/nodename
This file will only has the hostname, change it to the new hostname.

/etc/hostname.xxx
(where 'xxx' is your network interface name, like pcn0)
Like the file /etc/nodename, this file will only has the hostname, change it to the new hostname.

/etc/netmasks
This file associates Internet Protocol (IP) address masks with IP network numbers.

Changes to this file are only necessary if changing the IP address to a new subnet. Set the new netmask here.