Quick answer: On the VPS itself run hostnamectl set-hostname new-name.example.com and update /etc/hosts. To change the label shown in the Cloud2Y Client Area too, edit the hostname on the service page if editable, or open a ticket.
Overview
The hostname identifies your server in the shell prompt, logs and monitoring. Changing it inside Linux takes a minute and needs no reboot with hostnamectl. Note that the reverse DNS (PTR) record of your IP is separate — set it in the Client Area if you send mail.
Before you start
- SSH access as root.
- A fully qualified name you control, e.g.
vps1.yourdomain.com(recommended, not mandatory).
Step-by-step guide
- Set the new hostname (systemd distros — Ubuntu, Debian, AlmaLinux, Rocky):
hostnamectl set-hostname vps1.yourdomain.com - Update
/etc/hostsso sudo and local tools resolve it:nano /etc/hosts # make the 127.0.1.1 (Debian/Ubuntu) or 127.0.0.1 line include the new name: 127.0.1.1 vps1.yourdomain.com vps1 - Verify:
hostnamectl hostname -f - Re-login to see the new prompt. Optionally add a DNS A record pointing the name to your IP, and set the PTR record in the Client Area.
Common issues
sudo: unable to resolve host? The new name is missing from/etc/hosts— fix step 2.- Client Area still shows the old name? The label there is managed separately — edit it on the service page if the field is editable, otherwise open a ticket.
- Mail marked as spam? Ensure hostname, A record and PTR all match if the server sends email.
When to contact support
To update the hostname label in the Client Area when it isn't editable, or to set a PTR record you can't set yourself, open a support ticket.
Frequently asked questions
Does changing the hostname require a reboot?
No — hostnamectl set-hostname applies the new name immediately on any systemd-based distribution. Just log out of SSH and back in to see the updated shell prompt everywhere.
Does the hostname affect my websites?
No — websites are served by DNS records of their domains. The hostname is the server's own identity in logs and the prompt.
What about reverse DNS (PTR)?
PTR is a separate record for your IP, important for mail delivery. Set it in the Client Area or via a support ticket.
Related articles
- How to create a new user on Linux VPS
- How to secure your VPS after deployment
- First steps after your server is deployed
Need a hand? Contact Cloud2Y support →
