How to Change Server Hostname on CentOS Dedicated Server?

The blog post shows steps on how to change the hostname on CentOS dedicated server. There are two different methods for changing the server hostname on CentOS.

The first method to change the server hostname on CentOS is using the “Hostname command”.

Login to your dedicated server and open the console.

Fire the following command into the console:


Once the above command is fired, it will automatically change the server hostname on CentOS.

The second method to change  the server hostname on CentOS is via the “Editing network file”.

To do this, simply fire the below command into the console:

vi /etc/sysconfig/network

Where, “vi” is a file editor.

Once you enter the above command you will see something similar as shown below:


Now, just change the “hostname” there, save and exit the file using the following command.


That’s it! You’re done. Following the above steps the server hostname on CentOS dedicated server will be successfully changed.

About Robin Dale

Sr. Sales and Marketing Executive at bodHOST Ltd., likes to ensures that proper information and solutions to issues are available in Blog & Knowledgebase, also all of our customers are satisfied with the services and seeks to create new partnerships in order to increase the value of our services.
This entry was posted in Dedicated Server Hosting and tagged , , . Bookmark the permalink.