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 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 'mydomain.net.au' will change firstname.lastname@example.org to email@example.com 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.
Step 1 - Log into WHM and Select the List Accounts option.
Step 2 - Click on the + icon next to the domain you wish to change, then click on the Modify Account button.
Step 3 - Update the Primary Domain field to the new domain.
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 Modify.
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.