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

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

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

2. Edit to your preferred hostname :

NETWORKING=yes
HOSTNAME=MyNewHostname.localdomain

3. Save and reboot your server.

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

[root@localhost ~]# system-config-network

2. Go to “DNS Configuration”.
Hostname

READ  How to Install Red Hat Enterprise Linux 6.2 (RHEL 6.2)

3. Modify your preferred hostname and click OK.
Hostname

4. Click ” Save & Quit”.
Hostname

5.Reboot your server.

1 comment
  1. Hostgator Vps Webmin – Open Paducah • Post Author •
    September 15, 2015 at 1:04 pm

    […] How to Change the Hostname on RHEL 6/Centos 6 Server – 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 … […]

    Reply
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee