How to Change Your Primary Domain in WHM
If you use multiple aliases ( previously called parked domains) within a cPanel account, you may find yourself wanting to change the main domain used for the cPanel account containing these domains. Wanting to change the primary domain in cPanel is desirable for multiple reasons and many times occurs when the site in use switches from one TLD to another (i.e., .net to .com). You may desire to change this if the name of your company or site changes.
It can also occur when a domain is no longer used, or when the domain is removed from an account. Sometimes the wrong site name was set to be the primary domain, to begin with (we all make mistakes, right?). Whatever the reason for changing the primary domain, the change is relatively simple to make. However, it does make some potentially significant changes on the account that could create the need for additional changes for site functionality, so it is best to understand what these changes are before making the decision to change the main domain in cPanel.
Before Making Changes
Email & DNS
Making the change will modify multiple factors of the domain including (if you so choose) the cPanel username (which is usually not advised), the FTP username, and MySQL users. Making this change will delete any custom DNS records if you are using custom nameserver setup within WHM and hosting your DNS. If using custom nameservers be sure to go into the DNS editor and take a screenshot of your DNS for the domain or copy the records to a text document before making this change.
An additional effect is that all email accounts change to reflect the new domain, for example changing the primary domain from yourdomain.com to newdomain.com will change admin@yourdomain.com to admin@newdomain.com. You may then need to update the e-mail address and username (for both incoming and outgoing servers within your e-mail client) on any devices that e-mail account is set up on.
Aliases
If you already added an alias (a parked domain which shares content) or addon domain (which has its content apart from the main domain), you need to remove it first. Meaning you may need to save the content and site data for addon domains elsewhere on the server until after this change. You will also want to remove any subdomains of your primary domain name before you can change it as well. The following can be used as a basic guide to remove these as the process for each is the same:
Log into cPanel: yourdomain.com/cpanel
Navigate to and click on ‘Aliases’ (this may be listed as parked domains on older versions of WHM) (or you could locate subdomains or addon domains)
Locate the alias you want to be removed and click remove.
SSL Certificates
If you have an SSL certificate applied to this account, you will end up revoking the SSL installed for the current primary domain by removing it. In these cases a new SSL is necessary. If you are using AutoSSL, you may need to re-run to ensure all sites have an SSL installed appropriately. If you have purchased an SSL, you will need to order a new SSL for the new domain name.
Changing the primary domain may require modifying the siteurl if you are using WordPress, and this could break the installation until you change the URL.
Hostname
Often changing the primary domain is confused with the hostname of the server, these are separate changes. However, for clarity, this does not change the hostname of the server (your server name) and does not change the name of the server within your manage.liquidweb.com account either. Changing the primary domain will only change data related to the cPanel account and its associated user. While most changes are made within the cPanel account for the user, this change cannot be made within the cPanel account for the domain. Changing the primary domain is done via WHM which requires root level access.
Backups
Before making any significant changes on your server, it’s advised to have the ability to revert in case of mistakes. Here is information on Creating a full website backup via cPanel for the account you want to modify. Always ensure that you have available backups for the domain within the backup restoration area in WHM. These will be available if you already have backups configured within WHM. If you use alternate means to back up your accounts, ensure you have available backups before making this change.
How to Change the Primary Domain in cPanel
To change the primary domain, you will need to do this within WHM.
- You can access WHM by using the servers IP followed by the port 2087, or if DNS is set up for the hostname, you can access WHM by using the hostname/whm. Another method is to use a domain name on the server followed by /whm:Examples:
- 192.168.1.1:2087 (replace the IP with your servers IP)
- https://hostname.com/whm
- https://domainname.com/whm
- To change the primary domain login to WHM using the root user and root password:
- After logging the top right of your window is a search bar (you may need to expand this menu). Access List Accounts via the search bar and click on the link it displays.
- Find the user you want to modify by typing in the name of the account in the new search bar that opens. Then click the + symbol next to the user:
- Finally, click the Modify Account button:
- Change the Primary Domain to the domain you want in its place:
- Decide if you’re going to adjust options. You could decide to modify the databases associated with the domain to include new prefixes, for example, changing the Username.
After making this change, you may find that you want to keep the old email addresses used by the old primary domain. If this is the case, the fix is simple. Park the old domain on the new one via an alias and create new email accounts under the old domain name within cPanel’s email accounts section. This way you can still use your existing e-mail accounts and also change the primary domain.
You have successfully changed the primary domain for this account!
Our Support Teams are filled with talented admins with an intimate knowledge of multiple web hosting technologies, especially those discussed in this article. If you are Fully Managed VPS customer and you are uncomfortable with performing the outlined steps, we are simply a phone call, chat or support ticket away for assisting you with this process
Related Articles:
About the Author: Joel Parks
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Clone a Drupal Site to Another Domain
Read ArticleTop Eight Virtualization Security Issues and Risks
Read ArticleAccessing Man Pages on Ubuntu 16.04 LTS
Read ArticlePremium Business Email Pricing FAQ
Read ArticleMicrosoft Exchange Server Security Update
Read Article