Solaris Hostname / IP rename Procedure

In enterprise network environment, the life time of any server will be decided by the lifetime of the application that is running on top of Operating System. In case if the application was retired / decommissioned then that server can be utilized for the different applications.

Before using the existing servers for different application, the most common task to system admin is change the hostname of the server to reflect the new application. And sometimes, the server may have to move physically to different subnet to support the new application.

Below instructions will give you quick Idea on the procedures to change Hostname and IP address of a server.

Changing the HostName

1. Edit the following files and globally replace the old name with the new name as necessary.

    > /etc/inet/hosts

    > /etc/nodename
    > /etc/hostname

whereis replaced by the name of the primary interface for the system, e.g., “hme0”. It is possible that this file contains an IP address instead of a name, if this is the case you may leave this file as it is unless you are also changing IP addresses (see below).

2. If you are running a version of Solaris prior to 10 you should also edit the following files.

      • /etc/net/ticlts/hosts
      • etc/net/ticots/hosts
      • /etc/net/ticotsord/hosts

3. For Versions of Solaris later than 7, check the /etc/inet/ipnodes file and edit it appropriately.

4. Reboot the system.

Changing IP Addresses

1. Edit the /etc/inet/hosts file as necessary.

2. Check each interface configuration file and edit it as appropriate. These files may be listed using the find command as follows.

      • # /usr/bin/find /etc -name hostname.*

Note : Each file may contain a name rather that an IP address and may be left alone if this is the case.

2. If you are running a version of Solaris prior to 10 you should also edit the following files.

      • /etc/net/ticlts/hosts
      • etc/net/ticots/hosts
      • /etc/net/ticotsord/hosts

3. For Versions of Solaris later than 7, check the /etc/inet/ipnodes file and edit it appropriately.

4. If you changing IP addresses because the host has moved to a different subnet you may also need to amend the following files.

      • /etc/inet/netmasks
      • /etc/defaultrouter
      • /etc/resolv.conf

5. Reboot the system.

Ramdev

Ramdev

I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com. You can connect me at - https://www.linkedin.com/in/unixadminschool/

4 Responses

  1. Yogesh Raheja says:

    Nice Mate!!!..

    One more thing which I would like to add, suppose you dont have downtime while changing your host name, we should change the file (sol 10/ or previous versions) and just execute hostname . It will change your hostname and when you will get the downtime, reboot, server will come up with the new server name.
    Note: Carefully edit the files. :)

  2. Yogesh Raheja says:

    command would be:

    #hostname

    and you have to edit all the files as stated in the post by Ram.

  3. Muneer says:

    Soalris 10 restrat svcadm restart svc:/network/physical:default , no need to reboot the system.

  4. Yogesh Raheja says:

    @Muneer, nice point for Solaris 10. Will surely try it out. But for rest of the versions reboot is must..:)

What is in your mind, about this post ? Leave a Reply

Close
  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us