Skip to content

Changing a WHM server hostname without breaking licensing, mail, or DNS cluster trust

A hostname change touches the cPanel licence, AutoSSL certs, the mail HELO banner, and any DNS cluster the server participates in. A short runbook in the safe order.

A WHM server was provisioned as srv03.oldname.com two years ago, the company renamed, and now somebody wants the box to be srv03.newname.com. The temptation is to run hostnamectl set-hostname and walk away. Five minutes later the cPanel licence is invalid, AutoSSL certs are misaligned with the new hostname, the mail server’s HELO is wrong, and the DNS cluster has dropped the box because the trust relationship was keyed on the old name. Hostname changes on a WHM server are a runbook, not a command.

What’s happening

WHM uses the hostname for cPanel licensing (manage2 keys it to the IP and hostname combination), AutoSSL certificate generation (the cPanel host’s cert covers the hostname), Exim HELO and DKIM signing identity, DNS cluster member identity, and the WHM/cPanel server banner. Changing the hostname without updating each of these leaves a server that “works” but fails in odd ways: outbound mail starts to be quarantined because the HELO doesn’t match the rDNS, the WHM HTTPS cert shows the old name, and the DNS cluster reports the server as offline.

How to verify

Audit the current hostname plumbing before changing anything:

hostname
hostnamectl
whmapi1 gethostname
cat /etc/hostname /etc/mailname /etc/exim.conf | grep -i hostname
dig +short -x $(hostname -i)
whmapi1 listsslcerts
whmapi1 list_dns_cluster_peers

The rDNS for the server’s primary IP needs to match the hostname for mail; if it doesn’t, fix the rDNS at the provider before changing the hostname. The DNS cluster peer list shows the hostname each peer uses — if you change it, every peer needs the new entry.

The fix

  1. Update the rDNS at the upstream provider first. Confirm dig +short -x <primary-ip> returns the new hostname before touching the server. This is the only step you cannot retry.
  2. Change the hostname through WHM, not through hostnamectl alone: whmapi1 sethostname hostname=srv03.newname.com. This updates /etc/hostname, /etc/wwwacct.conf, Exim’s primary_hostname, and triggers a cPanel licence re-check against manage2.
  3. Regenerate the cPanel service certificate: whmapi1 install_service_ssl_certificate service=cpanel. Otherwise the WHM HTTPS endpoint still presents the old hostname.
  4. Re-trust DNS cluster peers. From each peer: remove the old hostname, add the new one via WHM’s Configure Cluster, and re-enable. The cluster does not handle renames; it handles add and remove.
  5. Re-issue any AutoSSL certs that referenced the old hostname (whmapi1 start_autossl_check_for_one_user user=acme for each affected user) and verify the new ones via listsslcerts.

Hostname changes on production hosts are the kind of work Stack Harbor’s cPanel server management team scripts and rolls into change windows so the cutover doesn’t leave any of the seven downstream systems pointing at the old name.