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.comormyserver)
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 22Step 2: Check Current Hostname
hostnameAlso check the full hostname:
hostname -fStep 3: Change Hostname Temporarily
hostname new-hostnameExample:
hostname web01.hostxpeed.comThis change is temporary and will reset after reboot.
Step 4: Change Hostname Permanently
For Ubuntu/Debian:
sudo hostnamectl set-hostname new-hostnameExample:
sudo hostnamectl set-hostname web01.hostxpeed.comFor CentOS/Rocky/AlmaLinux:
hostnamectl set-hostname new-hostnameStep 5: Edit /etc/hosts File (Important)
Open the hosts file:
nano /etc/hostsFind 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 web01Or with your server IP:
YOUR_SERVER_IP web01.hostxpeed.com web01Step 6: Verify Changes
hostnamehostname -fhostnamectlMethod 2: Change Hostname via Hostxpeed Portal
Some VPS plans allow hostname changes through the portal:
- Log in to your Hostxpeed Client Area at https://server.softileo.com
- Go to My Services
- Click on your VPS service
- Look for a Hostname or Server Name field
- Click Edit or Change
- Enter your new hostname and save
- 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 bashOr log out and back in:
exitThen reconnect:
ssh hxroot@YOUR_SERVER_IP -p 22✅ Your hostname has been successfully changed. Your command prompt should now show the new hostname.