How to Change a Hostname on Solaris

Solaris makes it unreasonably difficult to change an installed server’s hostname.

To change the hostname on a Solaris system, edit all of these files:

  • /etc/hosts
  • /etc/nodename
  • /etc/hostname.*
  • /etc/inet/ipnodes

When file editing is complete, reboot the server to test the changes and ensure that they operate correctly.

Solaris hostname dialogNote that changing the hostname only changes the name by which the machine refers to itself. This does not change the DNS name or names of the host.

8 thoughts on “How to Change a Hostname on Solaris”

  1. In Solaris 10 (and maybe older ones, not sure how far back this goes), I found that

    # /etc/net/ticlts/hosts
    # /etc/net/ticots/hosts
    # /etc/net/ticotsord/hosts

    are not necessary to edit. When you enter the file it says these are no longer consulted and will be removed from future versions. The others should suffice.

    1. Thanks Amanda, I edited those out. Good to hear it’s improving, but that still leaves quite a few files to edit. In Linux I think it’s just one file.

  2. Hi
    On  Solaris 10 , i would like to create  a User and the Home directory is /TEST
    whenever i use the Command to create a user with the command
    useradd <name>
    the Home directory is  /export/home
    i need a command so the default home directory of the User goes to /TEST
     
    Thanks in Advance

    1. Have you tried looking at man useradd? It might list how to use the command to specify a home directory. Maybe it’s useradd -d /home/directory username

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>