Skip to content
Solar Account.
Education & Software

How to Change the Main Domain in cPanel: A Complete Technical Guide

Changing your primary domain in cPanel involves updating the root identity of your hosting account. While users with Web Host Manager (WHM) access can perform this change through the "Modify an Account" tool, shared hosting users must typically request a chang...

How to Change the Main Domain in cPanel: A Complete Technical Guide

Changing your primary domain in cPanel involves updating the root identity of your hosting account. While users with Web Host Manager (WHM) access can perform this change through the "Modify an Account" tool, shared hosting users must typically request a change via their provider's support team. The process requires updating DNS records, SSL certificates, and application-level configurations.

Contents

Understanding the Role of the Primary Domain in cPanel

In the architecture of a cPanel-managed server, the primary domain is not merely a label; it is the foundational identifier for the entire hosting account. When an account is first created, cPanel uses the primary domain to establish the directory structure, specifically the public_html folder, and to route all system-generated emails. Unlike addon domains or aliases, which function as secondary layers, the primary domain is tied to the account's username and internal configuration files.

As we navigate the hosting landscape of 2026, the need to change a main domain frequently arises from rebranding, business acquisitions, or the transition from a development URL to a live production environment. However, because this change alters the absolute paths for scripts and the prefix for email accounts, it is a high-impact operation. Changing the domain name does not automatically move your files; rather, it updates the server’s configuration to point the new domain at your existing data.

It is important to distinguish between a domain "alias" and a "primary domain change." An alias simply allows a second domain to display the same content as your primary. A primary domain change, conversely, replaces the original domain entirely as the account's main identity.

Essential Prerequisites and Safety Measures

Whm: How To Change The Primary Domain On A Cpanel Account

Before initiating a domain change, you must ensure that several technical conditions are met to avoid extended downtime or data loss. In the current year 2026, server security protocols are more stringent than ever, making preparation the most critical phase of the migration.

1. Perform a Full Account Backup

Never attempt a primary domain change without a fresh full-account backup. This should include your home directory, MySQL/MariaDB databases, email forwarders, and filters. If the domain change causes a configuration mismatch (often referred to as a "broken pipe" in server logs), having a .tar.gz archive of your account allows for a full restoration to the previous state.

2. Verify Domain Ownership and DNS Readiness

The new domain must be registered and active. You should also ensure that the Name Servers for the new domain are pointed toward your hosting provider. While you can change the domain in cPanel before updating DNS, your site will remain inaccessible until the DNS propagation—which can still take up to 24 hours in 2026—is complete.

3. Inventory of Path-Dependent Scripts

Check your website’s configuration files (such as wp-config.php for WordPress or configuration.php for Joomla). These files often contain hardcoded paths or URLs that include the primary domain. You will need to update these manually after the change is processed at the server level.

Method 1: Changing the Main Domain via WHM (Root/Reseller Access)

If you own a VPS (Virtual Private Server) or a Dedicated Server, or if you are a Reseller, you likely have access to Web Host Manager (WHM). This is the most direct way to change a primary domain.

  1. Log in to WHM: Access your WHM administrative interface (usually via port 2087).
  2. Navigate to List Accounts: In the left-hand search bar, type "List Accounts" and select it.
  3. Locate the Account: Find the cPanel account associated with the domain you wish to change. Click the "+" icon next to the domain name.
  4. Modify the Account: Click the "Modify an Account" button.
  5. Enter the New Domain: In the "Basic Information" section, locate the "Domain" field. Replace the old domain name with your new primary domain name.
  6. Update the Username (Optional): WHM may give you the option to change the account username to match the new domain. Exercise caution here, as changing the username will change your database prefixes and your home directory path (e.g., from /home/olduser/ to /home/newuser/), which can break almost every application on the account.
  7. Save Changes: Scroll to the bottom and click "Save."

Once saved, WHM updates the Apache or Nginx configuration, reconfigures the mail routing, and updates the internal cPanel metadata.

Method 2: Changing the Main Domain on Shared Hosting

Most users on shared hosting environments do not have access to WHM. For these users, the "Main Domain" field in the cPanel dashboard is usually locked for security and administrative reasons.

Why You Can’t Always Do It Yourself

Hosting providers lock this feature because changing the main domain affects the server's billing system and license allocations. Furthermore, on a shared server, several accounts share an IP address; a manual change by a user could potentially conflict with existing virtual host entries.

The Support Request Process

To change your main domain on shared hosting, you must contact your provider’s technical support team. When submitting your request, provide the following:

  • The current primary domain name.
  • The new primary domain name.
  • Confirmation that you have backed up your data.
  • Clarification on whether you want the old domain to remain as an "addon domain" or be removed entirely.

Most reputable hosts in 2026 perform this task within a few hours, though some may charge a nominal administrative fee for the manual configuration update.

Post-Change Checklist: Critical Updates for Your Website

After the server-level change is complete, your website will likely not work correctly until you perform several application-level updates.

Feature Impact of Change Required Action
SSL Certificates Original SSL becomes invalid for the new domain. Re-issue AutoSSL or install a new SSL via Let's Encrypt.
Email Accounts user@old.com becomes user@new.com. Update login credentials in Outlook, Gmail, or mobile devices.
Databases Hardcoded URLs in tables will point to the old domain. Perform a search-and-replace on the SQL database for the new URL.
Application Config Scripts may look for files in the wrong directory. Update wp-config.php or .env files with the new domain/path.
Cron Jobs Paths in cron commands may reference the old domain. Manually review and update the "Cron Jobs" section in cPanel.

Updating Content Management Systems (CMS)

If you are using WordPress, the site will likely fail to load or show a CSS-less page after the domain change. You must log in to the database via phpMyAdmin and locate the wp_options table. Change the siteurl and home values to the new domain. Alternatively, you can add these lines to your wp-config.php file: define('WP_HOME','https://newdomain.com'); define('WP_SITEURL','https://newdomain.com');

SEO Implications and Redirection Strategy

A primary domain change is a significant event for Search Engine Optimization (SEO). If you do not handle the transition correctly, you risk losing years of accumulated "link juice" and search rankings.

Implementing 301 Redirects

The most important step is to implement 301 (permanent) redirects from the old domain to the new one. This tells search engine crawlers that the content has moved permanently. You can do this by adding the following code to the top of your .htaccess file in the public_html directory:

RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ RewriteRule ^(.*)$ https://www.newdomain.com/$1 [R=301,L]

Google Search Console: Change of Address

Navigate to your Google Search Console account. Add and verify the new domain. Once verified, use the "Change of Address" tool found under the "Settings" menu. This notifies Google to index the new URL and transfer signals from the old domain to the new one. This tool is essential for maintaining your search presence in 2026's competitive digital landscape.

Updating Internal and External Links

While 301 redirects handle traffic, you should still update internal links within your site's content to improve performance and user experience. Furthermore, reach out to high-authority websites that link to you and request that they update their backlinks to your new domain.

FAQ

Will changing my main domain delete my emails?

Changing the main domain does not delete the physical mail folders on the server, but it does change the email addresses themselves. If your old email was info@old.com, it will automatically become info@new.com. You will need to recreate the account in your email client using the new address. Any mail stored on the server under the old username will typically be preserved in the same folder structure, but you must ensure the account username remains the same.

How long does it take for the new domain to start working?

The server-side change in cPanel or WHM is nearly instantaneous. However, the global DNS system must update to point the new domain to your server's IP address. This process, known as propagation, typically takes between 1 and 24 hours. During this time, some visitors may see the new site while others see the old one or a "Server Not Found" error.

Can I change the primary domain if I have a dedicated IP?

Yes, having a dedicated IP address does not prevent you from changing the primary domain. In fact, it often makes the process smoother as the IP-to-domain mapping is exclusive to your account. You will simply need to ensure your new domain's "A Record" is pointed to that specific dedicated IP.

What happens to my addon domains when I change the primary domain?

In most cases, addon domains remain unaffected because they reside in their own subfolders within public_html or at the same level as public_html. However, if your addon domains use the primary domain as their "document root" or if they are subdomains of the primary domain (e.g., blog.olddomain.com), those specific instances will break and will need to be reconfigured.

Do I need to buy a new SSL certificate?

Yes, SSL certificates are tied to specific domain names. The certificate for olddomain.com will not work for newdomain.com. If your host provides AutoSSL or Let’s Encrypt, the server will attempt to generate a new certificate for the new domain within 24 hours of the change, provided the DNS is correctly pointed.

Technical Recommendation for a Seamless Transition

For the most stable results when changing a cPanel main domain, we recommend the "Parallel Setup" approach if your hosting resources allow. Instead of an immediate swap, add the new domain as an Addon Domain first. This allows you to migrate your files and test the site's functionality under the new URL without taking the old site offline. Once the new version is fully functional, you can then perform the primary domain swap through WHM or Support.

This method minimizes downtime and provides a safety net if the application configuration proves more complex than anticipated. Always remember to monitor your server logs for 404 errors immediately following the change to identify any forgotten assets or hardcoded paths that require manual correction.

Written by

Elizabeth Ward

Real Estate & Housing Analyst