How to Change the Hostname on CentOS 5.5 Server

In this post, i will show you how to change the hostname on linux CentOS 5.5. Reboot is required for both steps.

Option 1. Change Hostname using command shell:

[root@server ~]# vi /etc/sysconfig/network

Change the HOSTNAME=your_preferred_hostname

Option 2. Change Hostname using GUI
Type Setup as below and Press Enter

[root@server ~]# setup

Select Network Configuration –> Edit DNS Configuration –> Hostname