How to Change the Server Hostname on CentOS

April 14, 2011 / Dedicated Server

This tutorial will show you how to change the dedicated server hostname on CentOS.  The server hostname can be changed in two ways shown below.

The first way is by using the “Hostname command”.

Enter the following command into the console:


Once you enter the above command, the server hostname will be automatically changed.


you can change the server hostname using the “Editing network file”.

Enter the following command into the console:

vi /etc/sysconfig/network

After entering the command you will see something like this:


Simply, change your “hostname” there and you are done. I hope it will help.

Like this post ?

Share on your Social Networking Profile ( Facebook, Twitter & Google+ ) and get a flat 10% Recurring discount on our VPS Hosting and Dedicated Servers.

Email us the shared link at : [email protected] or speak to our live chat operator now, by clicking on the “Live Chat” Scroller on the left-hand side of this page and we will provide you with the discount Coupon right away!

Spread the love