Hostxpeed
Login Get Started →
Getting Started

How to Set Hostname on Your VPS

5 min read
23 views
Jun 12, 2026

Prerequisites

Before changing your hostname, make sure you have:

  • SSH access to your VPS (username: hxroot)
  • Your server IP address and root password
  • A desired hostname (e.g., web01.yourdomain.com or myserver)

What is a Hostname?

A hostname is a label that identifies your server on the network. It appears in your command prompt and helps identify the server in logs and network communications.

Method 1: Change Hostname via Command Line (SSH)

Step 1: Connect to Your VPS

ssh hxroot@YOUR_SERVER_IP -p 22

Step 2: Check Current Hostname

hostname

Also check the full hostname:

hostname -f

Step 3: Change Hostname Temporarily

hostname new-hostname

Example:

hostname web01.hostxpeed.com

This change is temporary and will reset after reboot.

Step 4: Change Hostname Permanently

For Ubuntu/Debian:

sudo hostnamectl set-hostname new-hostname

Example:

sudo hostnamectl set-hostname web01.hostxpeed.com

For CentOS/Rocky/AlmaLinux:

hostnamectl set-hostname new-hostname

Step 5: Edit /etc/hosts File (Important)

Open the hosts file:

nano /etc/hosts

Find the line with 127.0.1.1 or your server IP and update it:

127.0.0.1   localhost
127.0.1.1   web01.hostxpeed.com   web01

Or with your server IP:

YOUR_SERVER_IP   web01.hostxpeed.com   web01

Step 6: Verify Changes

hostname
hostname -f
hostnamectl

Method 2: Change Hostname via Hostxpeed Portal

Some VPS plans allow hostname changes through the portal:

  1. Log in to your Hostxpeed Client Area at https://server.softileo.com
  2. Go to My Services
  3. Click on your VPS service
  4. Look for a Hostname or Server Name field
  5. Click Edit or Change
  6. Enter your new hostname and save
  7. Reboot your server for changes to take effect

💡 If you don't see this option, use the SSH method above.

Hostname Naming Conventions

Good hostname examples:

  • web01.hostxpeed.com (Web server #1)
  • db01.hostxpeed.com (Database server #1)
  • mail.hostxpeed.com (Mail server)
  • hostxpeed-vps-01 (Simple VPS name)

Hostname rules:

  • Use only letters (a-z), numbers (0-9), and hyphens (-)
  • Cannot start or end with a hyphen
  • Maximum 63 characters per label
  • Can include dots for FQDN (Fully Qualified Domain Name)

Apply Changes Without Rebooting

To apply the new hostname to your current session:

exec bash

Or log out and back in:

exit

Then reconnect:

ssh hxroot@YOUR_SERVER_IP -p 22

✅ Your hostname has been successfully changed. Your command prompt should now show the new hostname.

Was this article helpful?