System Administration Guide: Advanced Administration

ProcedureHow to Change a System's Host Name

A system's host name is specified in several different locations.

Remember to update your name service database to reflect the new host name.

Use the following procedure to change or rename a system's host name.

You can also use the sys-unconfig command to reconfigure a system, including the host name. For more information, see the sys-unconfig(1M) man page.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Change the system's host name in the following files:

    • /etc/nodename

    • /etc/hostname.*interface

    • /etc/inet/hosts

    • /etc/inet/ipnodes – Applies only to some release Solaris releases.

    Note –

    Starting with the Solaris 10 8/07 release, there is no longer two separate hosts files. The /etc/inet/hosts file is the single hosts file that contains both IPv4 and IPv6 entries. You do not need to maintain IPv4 entries in two hosts files that always require synchronization. For backward compatibility, the /etc/inet/ipnodes file is replaced with a symbolic link of the same name to the /etc/inet/hosts file. For more information, see the hosts(4) man page.

  3. (Optional) If you are using a name service, change the system's host name in the hosts file.

  4. Rename the host name directory within the /var/crash directory.

    # cd /var/crash
    # mv old-host-name new-host-name
  5. Reboot the system to activate the new host name.

    # init 6