How to Change the Primary Domain in cPanel

How to Change the Primary Domain in cPanel

cPanel was originally designed with the assumption that a new primary domain would indicate a new site. It’s simple to change your primary domain, but keep in mind that cPanel software only changes the primary domain as listed in certain places in cPanel, not within the site files. If you are new, you may be surprised by just how much you will need to manually edit.

We cover what does and does not automatically change below, but if you’re new to cPanel the breakdown is not intuitive. Take your time, make backups beforehand, and only change your primary domain if you need to. To avoid errors, you should register your new domain name before switching your primary domain. Your old primary domain’s site files

will be in the same place as the new primary domain’s site files will go. If you want to create a new site, you must move or remove those old files.

What Does and Does Not Automatically Change

Before we get started on how to change your main domain, it’s important to understand what changes and what doesn’t. When you change your primary domain, it affects your email, website files, subdomains, and search engine ranking. Previous Domain Name: The previous main domain name on the account will be removed.

If you still need that previous main domain, you will need to log into your cPanel and add it as either a parked or addon domain name. Once the domain name has been changed, you will log into your cPanel via https://domainB.com/cpanel instead of https://domainA.com/cpanel.

Subdomains: All of your subdomains.domainA.com will turn into subdomains.domainB.com. For example, sales.domainA.com will now be sales.domainB.com.

Search Engine Rank: If you are changing your website’s domain name, keep in mind that this could affect your rank in search engines. Google recommends that you set up a 301 redirect — especially when keeping the old domain, which lets search engines know the website is permanently moving.

What About WordPress and Other Software?

If you’re using a content management system or other website software (such as WordPress), keep in mind that changing the main domain may only be the beginning of the changes you’ll need to make. Please double-check the documentation for your software’s domain name changes. Our instructions for altering the site URL and home settings in WordPress can be found here.

Can I Remove the Primary Domain in cPanel?

A principal domain is required for cPanel to work. You don’t have to use the principal domain, but it must exist in order for cPanel to function. If you need to use a placeholder domain, simply put a random phrase, random numbers, or a domain you do not own. You can still log in to your account using your server’s hostname or another domain name, and can even work on your site in the browser if you use a hosts file modification.

To Change the Primary Domain in cPanel Account

  • To change the primary domain login to WHM using the root user and root password:
  • Click the List Accounts option under the Account Information section.
  • Click the ‘+‘ icon beside the domain you want to change.
Change the Primary Domain in cPanel
  • Click the Modify Account button.
  • Enter the new domain name in the Primary Domain field.
 Primary Domain in cPanel
  • Scroll down to the end and click the Save button.

After making this change, you may find that you want to keep the old primary domain’s email addresses. If this is the case, the solution is straightforward. Using an alias, park the old domain on the new one and create new email accounts under the old domain name in cPanel’s email accounts section. You can continue to use your existing email accounts while also changing the primary domain.

You have successfully changed this account’s primary domain! Our Support Teams are staffed with talented admins being well in a variety of web hosting technologies, particularly those discussed in this article. If you are a Fully Managed VPS customer and are unsure about following the steps outlined, we are happy to assist you.