How to change the primary domain name on a cPanel account


Note: This article is for cPanel/WHM VPS and Dedicated Server customers only. If you're on a Personal, Business, Professional or Reseller hosting plan, log into your Client Area and submit a support ticket so we can make this change for you.

Before you start: Changing the primary domain of a cPanel account has several effects to be aware of.
  • This will delete any self hosted DNS records for the original domain, and set any DNS records for the new domain back to the default values. If you have any non-default DNS records in place, they will need to be re-added after the change. We'd recommend navigating to cPanel > Zone Editor and taking note of the records.
  • By default, email accounts for the old domain change to reflect the new domain. Changing the primary domain from 'yourdomain.net.au' to 'newdomain.net.au' will change admin@yourdomain.net.au to admin@newdomain.net.au. You will need to update the Email Address and Username (for both incoming and outgoing server) on any devices that email account is set up on.
  • After the change, images/links on your website may not load fully at first. You will need to contact your developer to update any hard links in your website to reference the new domain.
  • Any SSL Certificates that reference the primary domain will need to be reissued for the new domain. If you are using a free certificate installed by AutoSSL, this will occur automatically upon the next check.


Step 1 - Log into WHM and Select the List Accounts option.

fbed5ec84ab0c6898bf811e70330ea29342561504664c2b3b549ca98fce4d235710274f5f9b48466?t=52b81b0f56cab813da90c845161c7152


Step 2 - Click on the + icon next to the domain you wish to change, then click on the Modify Account button.

f0478ca49ac203f73586623758696dcfb57a2ea19522c5a1e5a7eb3299f9623743861e20e4fdeada?t=ddb50fc1d3bdcfb116ae5e9241215006


Step 3 - Update the Primary Domain field to the new domain.

bd25a88c805cea5b4e81c57119d86af4b8cb0fdf59b51821f12c8fabb240958f6600e24057a4a2c1?t=b0de539c8ec93a15691ad07ff753c59e

Note: We highly recommend NOT changing the cPanel username. As the username is tied to the database name, you may get database errors relating to site code or configuration.


Step 4 - Scroll down to the bottom of the screen and click Save.

78ecf9eca8657844f36bdc3e5edcec8725ef65674f0fa48fc0ab1052ff626197254cfc7315e6be12?t=01a80f09e40cc9bffc92492d2fe25061

Note:
At this point, the primary domain will have been changed. You will now need to update any hard links inside your CMS to reflect the new domain. We have a guide on performing this in WordPress here.


Step 5 - (Optional) As a temporary step while you update links on your CMS, you may wish to add your old domain as an Alias onto the cPanel account, as seen here. This will have the benefit of having the old domain load as before until the links are updated.


How to keep email accounts using the old domain

If you're changing your primary domain but want to keep your email accounts on the old domain, follow these steps.

Note: cPanel doesn't provide this function directly, so we're unable to guarantee that this will work in future cPanel versions. We're also unable to provide detailed support with this. We recommend downloading a backup of the /home/cpaneluser/mail/ and /home/cpaneluser/etc/ folders (clients on Personal, Business, Premium, Reseller and Managed VPS servers will have the most recent 7 days of automated backups with us by default).


Step 1 - Log into the cPanel account you're planning to change.

Step 2 - Add your new domain as an Alias, as seen here.

Step 3 - Create an email account in cPanel for the new domain. This can be anything, but you could consider making copies of your existing email accounts for the new domain, to catch any emails going to the new domain instead.

Step 4 - Remove the new domain as an Alias from cPanel.

Step 5 - Follow the steps in this guide to complete the primary domain change as normal.


Thank you for your feedback on this article.