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:STEP 3: Test if the hostname works
$ 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
Example:
$ ping www.techpages.org
www.techpages.org is alive
$ ssh user@Techpages
password:



0 comments:
Post a Comment