Changing Hostname in CentOS / Red Hat Linux

Posted: December 12, 2012 in Linux / Redhat
Tags: , , ,

To change host name in Linux from command line, type:

vi /etc/sysconfig/network

Now, you will see a file such as the one shown below:

2

To change the hostname , you can change the highlighted to any thing you want. Press ‘i‘ or INSERT to edit the file. After making necessary changes, you can save the file by pressing ESC followed by :wq and hit ENTER.

Now, restart to make necessary changes. You can reboot by typing the following in the command line:

reboot

After reboot, login and check your hostname by typing the following in the terminal / command line :

hostname

 

Hope this helps!  🙂

ΞXΤЯ3МΞ

Comments
  1. Renee says:

    There is an Online Christmas Party at Marsha Lee’s Blog! Celebrating my birthday and Christmas! Feel free to stop by and celebrate! http://tchistorygal.wordpress.com/2012/12/24/renees-online-birthday-party/
    Merry Christmas!
    Renee 🙂

Leave a comment