A Web.com Partner
Sign Up / Log In
Online Support Linux Servers

How to assign a Hostname for CentOS Linux Server

This tutorial shows you how to assign a hostname for a CentOS Linux Server.

Step 1. Log in to the server console as root user.
Step 2. Open the file /etc/sysconfig/network using text editor, such as VI.
assigning a hostname for CentOS Linux server step 2
Step 3. Edit the variable HOSTNAME='your hostname goes here', save and exit.
assigning a hostname for CentOS Linux server step 3
Step 4. Reboot your server. Your server will boot up with the new hostname.
assigning a hostname for CentOS Linux server step 4

Congratulations, you have assigned a hostname for the CentOS Linux Server.

Was this helpful? Yes No 78% of people found this helpful.
{"message":""}