How to Change Hostname in Linux

Method 1: Command Line

Step 1: Edit in /etc/sysconfig/network File

In order to change the hostname edit the following file:

# sudo nano /etc/sysconfig/network

Step 2: Modify /etc/hosts File

Edit /etc/hosts File and enter the hostname along with IP Address of server for local use.

# vi /etc/hosts localhost.localdomain localhost

Step 3: Modify the Hostname

# hostname
# hostname

Step 4: Restart Network

Now restart the network:

/etc/init.d/network restart

Method 2: GUI Environment

Step 1: Execute setup Command

# setup

Select Network Configuration Tab

Step 2: Select DNS Configuration


Step 3: Modify the Hostname

Once the changes have made, Select SAVE & QUIT and press ENTER key from keyboard.

3 replies
  1. wannajizz
    wannajizz says:

    Tһank yⲟu foг ѕome otһeг informative website.

    Tһe placе elose may ust I ցet that type оf information written in sucһ a perfect
    approach? Ӏ’ve ɑ mission tһat I’m jusat now operating
    on, and I һave beеn at tһе glance out for ѕuch informatіon.

    Heгe iѕ my weblog: wannajizz


Trackbacks & Pingbacks

  1. Homepage says:

    … [Trackback]

    […] Read More Infos here: […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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