How to Change the Hostname on CentOS 5.5 Server

Share this Article :

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:

    [[email protected] ~]# vi /etc/sysconfig/network

Change the HOSTNAME=your_preferred_hostname

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

    [[email protected] ~]# setup

Select Network Configuration –> Edit DNS Configuration –> Hostname