Posts Tagged ‘setting hostname on linux’

Changing Hostname on Linux Server

September 14, 2017 1 comment

In your Linux server, you can change the hostname of your server by following this simple steps. I’m using a Centos 6.9 as my server to this tutorial but I’m sure it applies to other Linux distros as well. First of all, edit the network file on the Linux server to change the hostname by typing this command:

vi /etc/sysconfig/network

Then, find the HOSTNAME variable and change it the name as you desired.

Next, apply the hostname change by typing:

hostname [name]

Replace the [name] with the host name that you want. Next, restart the network service to make the changes permanent.

service network restart