Set Hostname on CentOS

Step 1: Login to your VPS

Locate the IP address of your AKLWEB Host VPS and login as the root user.

ssh root@server

Step 2: Use the hostname utility

Change your hostname to a different name of your choosing. For example:

hostname server01

Step 3: Edit /etc/hosts

Open the /etc/hosts file with your favorite text editor. For example:

nano /etc/hosts

Change the first line and replace your old hostname with the new one. Save the file and exit the editor.

Step 4: Edit /etc/sysconfig/network

This file also contains your hostname. Open the /etc/sysconfig/network file with your favorite text editor.

Change HOSTNAME=akl-web-host to your desired hostname. For example: HOSTNAME=server01.

Step 5: Check your hostname

Run the following command to check your new hostname:

hostname

The new hostname will be displayed in your ssh terminal.

Step 6: (Optional) Change reverse DNS

Visit http://vmserver.aklwebhost.com:5353/, then navigate to your VPS. Click on the IPv4 tab. You will see an "Update" button in the "Reverse DNS" column. Click this button to update the reverse DNS address. By default it will read:

x.x.x.x.akl-web-host.com

It is common to replace x.x.x.x.akl-web-host.com with the DNS name of your server, which may be related to its hostname.

  • Set Hostname on CentOS
  • 1 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

Setting up a Name Server for IPv6 rDNS in CentOS

Managing your own IPv6 rDNS is a fairly simple task. After setting up the name server, please...

Reset the Root Password in CentOS

If you have forgotten the root password it is possible to set a new one by interrupting the boot...

How to Install and Configure vsftpd on CentOS 7

FTP (File Transfer Protocol) is one of the most popular methods to upload files to a server....

How to enable EPEL repository?

The EPEL repository is an additional package repository that provides easy access to install...

Find (View) Default Zone for Firewall on CentOS 7

Pre-Flight Check These instructions are intended for finding (viewing) the default zone in...