Introduction

While there are things about Solaris that can be frustrating, this is one aspect where it’s impressive! You don’t need to restart your machine to change the hostname - it updates live. I have to admit that’s pretty cool.

Temporary Method

Here’s the temporary method (which will be lost after reboot):

  hostname machine_name
  

And to verify:

  hostname
  

Manual Method

The method provided here doesn’t use any utilities.

Edit the following files and modify the HOSTNAME value:

  • /etc/inet/hosts
  • /etc/net/ticlts/hosts
  • /etc/net/ticots/hosts
  • /etc/net/ticotsord/hosts
  • /etc/nodename
  • /etc/hostname.[identifier of the interface that associates the IP address with the HOSTNAME]

Then go to /var/crash and rename the directory:

  cd /var/crash
mv oldname newname
  

All that’s left is to restart.

In the case of a cluster, modify these files (except if the cluster is not yet configured on this machine):

  • /etc/cluster/nodeid

Last updated 05 Dec 2008, 14:18 +0200. history