client-alerts-black-week-icon.svg

BLACK NOVEMBER SALE! Up to 60% off websites, hosting and VPS.    00 Days Days 00 Hours Hrs 00 Minutes Min 00 Seconds Sec

Back to Article List

How to Change the Primary Domain in cPanel (WHM and Plesk)

How to Change the Primary Domain in cPanel via WHM - How to Change the Primary Domain in cPanel (WHM and Plesk)

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

  1. Take a full backup. Use the Backup tool in cPanel or the backup system in WHM. Keep a copy off the server.
  2. 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.
  3. List email accounts and forwarders. Note every mailbox on the old domain and who uses it.
  4. 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.
  5. Tell people. Let staff and key clients know if email addresses will change.

How to change the primary domain in cPanel through WHM

  1. Log in to WHM. Use your server's WHM address, usually on port 2087, with root or reseller details.
  2. 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.
  3. Select the user. Pick the account by domain or username and click Modify.
  4. 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.
  5. 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.
  6. 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

ItemWhat usually happensWhat to check
Website filesStay in public_html and serve the new domainLoad the new domain once DNS has updated
DNS zoneA zone is set up for the new domain on the serverRe-add custom MX, TXT and service records you noted
Email accountsMail settings follow the new domain name in most setupsTest each mailbox and update phone and desktop mail apps
SSL certificateAutoSSL or your SSL tool issues a new certificate once DNS resolvesCheck the padlock on the new domain
Old domainStops being served by this accountAdd it back as an alias or redirect if you still own it
SubdomainsMove under the new main domainTest 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.

  1. 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.
  2. 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.
  3. Redirect the old domain. Keep the old domain registered and add a permanent (301) redirect from every old URL to the matching new URL.
  4. Tell Google. Add the new domain in Google Search Console and use the Change of Address tool.
  5. Update listings. Change the address on your Google Business Profile, social profiles and email signatures.
Do not let the old domain expire straight away. Old links, bookmarks and search results will keep sending people to it for months. Renew it for at least a year and keep the redirect running. A .co.za domain costs R109 a year with us, which is cheap insurance for the traffic it carries.

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

ProblemLikely causeFix
WHM says the domain already existsThe new name is an addon, alias or subdomain somewhere on the serverRemove it from that account first, then try again
New domain shows the wrong site or a default pageDNS still points elsewhere or has not updated yetCheck the A record and wait for the TTL to expire
Email stops arrivingMX records missing or still on the old domainRe-add the MX and SPF records from your notes
Browser shows a security warningNo certificate yet for the new domainRun AutoSSL once DNS resolves, or install a certificate
WordPress redirects to the old domainSite address still set to the old nameUpdate the addresses and run a search-and-replace
Images or styles do not loadHard-coded links to the old domainSearch-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.

Changing the primary domain in cPanel: FAQs

How do I change the primary domain in cPanel?

Log in to WHM as root or as the reseller, open Account Functions, then Modify an Account. Select the user, replace the name in the Primary Domain field and click Save. Afterwards, check DNS records, email, SSL and your website settings so everything works on the new domain.

Changing your domain? Get the new name first

Search for your new domain, register it in minutes and let our team help you point it at your hosting and email. Every domain includes free DNS management, and .co.za names start at R109 a year.

Search for a domain Ask our team for help