How to define hostname in Solaris

Hostname is assigning a user defined name to a computer. When the computer is connected to the network, other devices in the network can easily identify and communicate with the computer using the hostname.

To define hostname,
STEP 1:  Login as root user

STEP 2: Open the /etc/hosts file and add the ip address of the machine followed by hostname. Multiple host names can be added for the same ip.

Example:
$ ping 25.26.27.28
25.26.27.28 is alive

$ su – root

$ vi /etc/hosts
 # Add the ip follwed by hostname(s)
25.26.27.28      www.techpages.org      TechPages      localhost

STEP 3: Test if the hostname works

Example:
$ ping www.techpages.org
www.techpages.org is alive

$ ssh  user@Techpages
password:

Related posts:

  1. How to Plumb an IPV6 interface in Solaris
  2. Steps to Install Redhat Linux

Comments are closed.