How to Change the Hostname on RHEL 6/Centos 6 Server

Share this Article :

We can change the hostname of the linux operating system by using two basic methods which using the command line or graphical interface. As a reference, this article will describe how to change the hostname Red Hat Enterprise Linux 6 (RHEL 6) or CentOS 6. Please note that the server reboot is required for both options below.

Option A:
1. Modify /etc/sysconfig/network

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

2. Edit to your preferred hostname :


3. Save and reboot your server.

Also Read :   How to Remove Gnome-Desktop using Yum

Option B:
1. Type the following command to enter GUI mode.

[[email protected] ~]# system-config-network

2. Go to “DNS Configuration”.

3. Modify your preferred hostname and click OK.

4. Click ” Save & Quit”.

5.Reboot your server.

No Responses

Leave a Reply