cPanel

How to change the primary domain of a cPanel account

What the primary domain of a cPanel account is, why you cannot change it from cPanel itself, how MdmHost changes it for you, and what to check before and after.

IntermediatecPanel hosting2 min read

Every cPanel account has one primary domain, the domain it was created with. Its website lives in public_html, and it is used for system addresses such as the default mailbox and the account's subdomains. When you rebrand, you may want a new domain to become the primary one. This guide explains your options.

Before you start

  • See your current primary domain in the General Information panel on the cPanel home page.
  • Register the new domain or have it ready to point to MdmHost. See register a domain.
  • Take a backup: download a cPanel backup.

Why you cannot change it in cPanel

The primary domain is part of the account's configuration on the server: DNS zone, web server settings, SSL and mail routing all reference it. cPanel users can add more domains but cannot rename the primary one. The change is made by the server administrator in WHM (Modify an Account). On MdmHost hosting, our support team does this for you.

Request the change from MdmHost

  1. Open a support ticket from the MdmHost dashboard.
  2. Include the current domain, the new domain, and whether the old domain should stay on the account as an addon domain or alias.
  3. We change the primary domain, keep your files in public_html, and recreate the DNS zone for the new domain.
  4. Point the new domain's nameservers to MdmHost, if they are not already.

If you are a reseller, you can do this yourself in WHM; see modify a cPanel account in WHM.

Note: Email accounts on the old domain are not renamed. If you want sara@newdomain.com, create the new mailboxes and move the mail, or keep the old domain as an addon domain so existing addresses keep working.

Alternative: keep the account, switch the site

If you only want visitors to use a new domain, you do not need to change the primary domain at all:

  1. Add the new domain as an alias sharing public_html.
  2. Change the site address in your app (for WordPress, see change the site URL).
  3. Redirect the old domain to the new one with a 301 redirect.

The account's internal primary domain stays the old one, which is invisible to visitors.

After the change

  • Check SSL/TLS Status: AutoSSL issues certificates for the new domain once DNS points to the server.
  • Update the site URL in your CMS and run a search-replace for the old domain.
  • Update email client settings if they used mail.olddomain.com; the server hostname always works. See email settings.
  • Set up redirects from the old domain to protect search rankings.
  • Update the domain in Google Search Console and analytics.

Troubleshooting

  • New domain shows a default page: DNS still points elsewhere; check with the WHOIS checker.
  • Mixed content or redirects to the old domain: the CMS still has the old URL stored.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.