Set Hostname on CentOS

  • Last Created On Dec 10, 2024
  • 6
0 0

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.

Views: 6

Recent Articles

  • How to Install JAX with ROCm Acceleratio...
    96
  • Deploy a PyTorch Workspace on a Vultr Cl...
    71
  • Managing Backup Storage
    82
  • Automating FTP Backups in Windows Server
    71
  • Automating FTP Backups in Linux
    75

Popular Articles

  • Our General Terms & Conditions
    2630
  • Our Privacy Policy
    2474
  • Our Cookies Policy
    275
  • Our Terms of Use
    152
  • How to Install JAX with ROCm Acceleratio...
    96