Advertisements
Home > Information Technology, Operating System > Changing Hostname on Linux Server

Changing Hostname on Linux Server

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

Advertisements
  1. November 8, 2017 at 10:07 am

    Please follow https://learningtechnix.wordpress.com/ for more free blogs on Linux/Automation/Scripting

  1. No trackbacks yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: