To change the primary domain in cPanel, log in to WHM as root or as the reseller who owns the account, open Account Functions, choose Modify an Account, select the user, type the new domain in the Primary Domain field and save. In most setups the cPanel user cannot do this from cPanel itself, so it is a job for the host or reseller. The switch takes a minute, but DNS, email, SSL and your website settings all need checking afterwards. This guide covers the preparation, the exact steps, what changes behind the scenes, how the same job works in Plesk, and how to fix the usual problems.
What you need before you start
- WHM access: a root login, or a reseller login with permission to modify accounts.
- The new domain, registered and active: with DNS you can edit, pointed at the server or ready to be.
- A full backup: files, databases and mail, downloaded or stored off the server.
- A list of what uses the old domain: mailboxes, forwarders, custom DNS records, cron jobs and app settings.
- A quiet time slot: early morning or a weekend, in case DNS takes a while to update.
If the new name is not registered yet, sort that out first through our domain name registration service, or bring an existing name across with a domain transfer. Changing the primary domain to a name you do not control will break the site.
What the primary domain in cPanel actually is
Every cPanel user has exactly one primary domain, also called the main domain. It is the name the hosting account was created with, and its website lives in the public_html folder. Addon domains, subdomains and aliases all hang off this main domain, and the cPanel username was often based on it too.
Because so much is tied to it, cPanel always needs a primary domain, even if you no longer use it for a website. You cannot delete it, only replace it. If you are unsure how addon domains, aliases and subdomains differ, our guide on domain vs subdomain explains the basics.
Prepare to change the primary domain in cPanel
- Take a full backup. Use the Backup tool in cPanel or the backup system in WHM. Keep a copy off the server.
- Write down custom DNS records. Export or screenshot the zone for the old domain, especially MX, TXT (SPF, DKIM, verification) and any records for external services like Microsoft 365 or Google Workspace.
- List email accounts and forwarders. Note every mailbox on the old domain and who uses it.
- Lower the TTL. A day before, drop the TTL on the new domain's records to around 300 seconds so changes spread faster. Our explainer on DNS propagation covers why this helps.
- Tell people. Let staff and key clients know if email addresses will change.
How to change the primary domain in cPanel through WHM
- Log in to WHM. Use your server's WHM address, usually on port 2087, with root or reseller details.
- Open Modify an Account. In the left menu go to Account Functions, then Modify an Account. You can also find the user in List Accounts and use the modify option there.
- Select the user. Pick the account by domain or username and click Modify.
- Enter the new primary domain. In the Primary Domain field, replace the old name with the new one. Type it without www and without https.
- Leave the username alone unless you must. Changing the username at the same time adds risk, because database names and paths use it as a prefix.
- Save. Click Save at the bottom of the page and wait for WHM to confirm the change. If the new domain already exists as an addon or alias on the server, WHM will refuse, so remove it there first.
The website files stay in public_html, so the content now answers on the new domain as soon as DNS points to the server.
What happens after you change the primary domain
| Item | What usually happens | What to check |
|---|---|---|
| Website files | Stay in public_html and serve the new domain | Load the new domain once DNS has updated |
| DNS zone | A zone is set up for the new domain on the server | Re-add custom MX, TXT and service records you noted |
| Email accounts | Mail settings follow the new domain name in most setups | Test each mailbox and update phone and desktop mail apps |
| SSL certificate | AutoSSL or your SSL tool issues a new certificate once DNS resolves | Check the padlock on the new domain |
| Old domain | Stops being served by this account | Add it back as an alias or redirect if you still own it |
| Subdomains | Move under the new main domain | Test each one and update any links |
Behaviour differs slightly between cPanel versions and server setups, which is why the backup and your notes matter. Test before you announce the change.
Update WordPress and keep your SEO
If the site runs WordPress, it still thinks it lives on the old domain until you tell it otherwise.
- Change the site address. In Settings, General, update the WordPress Address and Site Address to the new domain. If you are locked out, set them in wp-config.php.
- Replace old links in the database. Use a search-and-replace plugin or WP-CLI to swap the old domain for the new one, including serialized data.
- Redirect the old domain. Keep the old domain registered and add a permanent (301) redirect from every old URL to the matching new URL.
- Tell Google. Add the new domain in Google Search Console and use the Change of Address tool.
- Update listings. Change the address on your Google Business Profile, social profiles and email signatures.
When a new account is the better option
Sometimes changing the primary domain is not the cleanest route. If the old domain will keep its own website, or the account has years of addon domains and custom settings, many administrators create a fresh account on the new domain and migrate the site into it. That keeps the old account untouched as a fallback until you are sure everything works. It takes longer, but it is easier to undo.
The same job in Plesk
Our own web hosting plans run on Plesk rather than cPanel, and changing the main domain there is a little simpler. Open Websites & Domains, select the domain, open its hosting settings (shown as Rename on some Plesk versions), type the new name and save. Plesk updates the hosting, DNS zone and mail for that domain together, and you then reissue the SSL certificate for the new name.
The same rules apply: back up first, re-check custom DNS records, update WordPress and redirect the old domain. If you are comparing panels, our guide to web hosting control panels sets out the differences.
Troubleshooting a primary domain change in cPanel
| Problem | Likely cause | Fix |
|---|---|---|
| WHM says the domain already exists | The new name is an addon, alias or subdomain somewhere on the server | Remove it from that account first, then try again |
| New domain shows the wrong site or a default page | DNS still points elsewhere or has not updated yet | Check the A record and wait for the TTL to expire |
| Email stops arriving | MX records missing or still on the old domain | Re-add the MX and SPF records from your notes |
| Browser shows a security warning | No certificate yet for the new domain | Run AutoSSL once DNS resolves, or install a certificate |
| WordPress redirects to the old domain | Site address still set to the old name | Update the addresses and run a search-and-replace |
| Images or styles do not load | Hard-coded links to the old domain | Search-and-replace the database and clear caches |
If the change is part of a rebrand and you would rather not touch DNS and databases yourself, our website maintenance team can handle the move, redirects and checks for you.



