• Main Menu
  • 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.

    Got Something To Say:

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

    8 comments
    1. Augie

      10 May, 2011 at 6:15 pm

      Hi
      Finally i got the  answer  for the default home directory
      vi /usr/sadm/defadduser

      Reply
    2. Augie

      3 May, 2011 at 5:00 pm

      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

      Reply
      • memenode

        3 May, 2011 at 8:03 pm

        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

        Reply
      • Cliff

        28 September, 2011 at 8:37 am

        use # usermod -d /TEST -m <useracct>

        Reply
    3. Dave Abrahams

      31 January, 2011 at 2:50 am

      On Solaris 11, /etc/inet/ipnodes is the same as /etc/hosts.  Getting better all the time…

      Reply
      • Ryan N.

        22 March, 2012 at 4:13 pm

        That was true of 10 also, unless perhaps you upgraded from a version that did not do that.

        Reply
    4. Amanda

      9 January, 2011 at 1:30 am

      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.

      Reply
      • memenode

        11 January, 2011 at 8:17 pm

        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.

        Reply
    Unix
    181 queries in 0.532 seconds.