Change Host name in Centos 7

Today we are going to learn how to change the hostname in linux centos 7

Current hostname : localhost.localdomain

Need to change : exm.server.world

Note : Here exm is the hostname and server.world is the domain name.

Step 1 : To Check current hostname

[#] hostname1.PNG

Step 2 : To change hostname temporary

[#] hostname exm.server.world

1.PNG

Step 3 : To change hostname permanently (Reboot is required)

Procedure 1 : Use command to change the hostname

[#] hostnamectl set-hostname exm.server.world

1.PNG

1

Procedure 2 : Change hostname via editing the hostname file i.e /etc/hostname

1

1

1

Now save the hostname file and reboot the server to see the changes.

1

1

!!!!!!!!!!!!!!!!!!!!!!!!!!!! Hostname Changed Successfully !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.