Help Docs Server Administration Linux Server Administration Change Your Linux Server Hostname

Change Your Linux Server Hostname

Easily change your Linux server hostname via SSH — then update it in your Liquid Web account and DNS records.

Introduction

Changing your server’s hostname is a simple process, though it’s usually reserved for major events like branding updates. While not publicly visible, the hostname is critical because it appears in email headers and DNS records. This guide shows you how to update your hostname directly from the Linux command line using the hostnamectl command and editing key system files. We’ll also cover how to finalize the change in your Liquid Web account.

Consider using your Control Panel
If your server has a control panel such as Interworx, WHM / cPanel, or Plesk, we recommend you follow one of the following guides instead:

Prerequisites

Before you start make sure your system meets the following requirements:

  • Operating system: RHEL/CentOS 7+, AlmaLinux 8+, Ubuntu 16.04+, Debian 9+, etc.
  • Root SSH access 
  • Fully Qualified Domain Name that is reachable via DNS.
What is a Fully Qualified Domain Name (FQDN)?
A FQDN is the complete, unambiguous domain name for your server. It includes the specific host name (the machine name) and the rest of the domain name.

Format: hostname.domainname.tld

Example: server.yourcompany.com

Why is an FQDN mandatory?

  • DNS Resolution: For any external service (like email or remote connections) to reliably find your server, the FQDN must be translated into your server’s IP address. This critical function is handled by DNS (Domain Name System).
  • Email Deliverability: Many spam filters perform reverse DNS lookups (checking if the IP matches the FQDN). Using an FQDN that resolves correctly is vital for preventing your emails from being marked as spam.
  • SSL/TLS Certificates: Certificates used for securing web and control panel access (e.g., WHM/cPanel) must be issued to a valid FQDN.
  • Best Practice: Choose a descriptive, simple hostname (e.g., host, server, vps) and combine it with a domain you own. Remember that once you set the FQDN on the server, you must update the corresponding DNS A Record (mapping the FQDN to the server’s IP address)

Step-by-step instructions

Reporting your hostname
To keep your services in sync, be sure to update your hostname in the my.liquidweb.com portal after you change it. Instructions found below.

  1. Choose a unique name for the server. Common choices include server1, host, or a name related to its function.
  2. Identify the domain name you will use, such as yourdomain.com.
  3. Combine them into the hostname.domain.com format.
  4. To change your hostname, run either of the commands listed below. Be sure to replace the placeholder <your-new-hostname> with your actual hostname:
    hostnamectl set-hostname <your-new-hostname>
    or
    hostname <your-new-hostname> 
  5. Log into your my.liquidweb.com to report your new hostname.
  6. Click on Servers > My Servers section located on the left panel and find your server in the list.
  7. Click on the “3 dots” menu located on the right side and click on Edit Hostname.
  8. Provide your new hostname in the Server Hostname input field, and click Update save the changes made
Hostname considerations
Avoid using a website’s domain name as the server’s hostname. Make sure the domain is registered and socially acceptable, as it will be visible in email headers.

Frequently asked questions

  • Make sure the changes are made inside the FQDN’s authoritative DNS zone. 
  • Make sure that the DNS zone of the FQDN is the authoritative one.

Make sure an A record was added for the new hostname inside FQDN’s DNS zone so an SSL certificate can cover the hostname as well. 

Was this article helpful?