blog

How to Change Primary Domain Name in cPanel & Web Hosting (2026 Step-by-Step Guide)

RM
Raj Mehto Hosting & Infrastructure Analyst
Mar 23, 2023 8 min read
How to Change Primary Domain in cPanel 2026 Guide

Whether you are rebranding your business, upgrading to a shorter .com or country-code domain extension, or fixing a typo made during registration, there comes a time when you need to change the primary domain name associated with your web hosting account.

Because your primary domain in cPanel is directly bound to your public_html document root, your email inboxes, SSL certificates, and database site URLs, changing it must be done carefully to prevent broken links, email delivery failures, or 404 errors.

In this 2026 step-by-step guide, you will learn the exact methods to change your primary hosting domain name smoothly without losing your files, databases, or SEO equity.

⚠️

Important Pre-Change Checklist:

  • Take a Full cPanel Backup First: Go to cPanel → Backup Wizard and download a full backup archive of your site and MySQL databases.
  • Register & Point New Domain: Ensure your new domain is registered and pointed to HeroHosty’s nameservers (ns1.herohosty.xyz & ns2.herohosty.xyz).
  • Email Account Migration: Changing the primary domain changes the domain part of your email inboxes (e.g., [email protected] becomes [email protected]).

Method 1: Change Primary Domain via HeroHosty Client Area (Instant)

On HeroHosty, users can request an instant primary domain modification directly from their billing dashboard without needing to recreate their hosting account:

  1. Log in to the HeroHosty Client Area.
  2. Go to Services → My Services and click on your active hosting package.
  3. Under the Actions menu on the left sidebar, select Change Domain or open a quick 1-click ticket to our 24/7 technical team specifying:
    • Your current domain: olddomain.com
    • Your requested new primary domain: newdomain.com
  4. Our automated systems update your cPanel virtual host file, pointing your new domain directly to public_html in under 5 minutes without touching your existing website files!

Method 2: Using cPanel Addon Domains (Alternative Multi-Site Approach)

If you are on HeroHosty’s Business or Premium shared plan (which supports multiple websites), you do not necessarily need to replace your primary domain. You can simply add your new domain as an Addon Domain:

  1. Log in to your cPanel dashboard.
  2. Navigate to Domains → Domains and click Create A New Domain.
  3. Enter your new domain name (e.g., newdomain.com).
  4. Uncheck “Share document root” if you want a separate website, or keep it checked if you want the new domain to serve the exact same files as your primary domain.
  5. Click Submit. Your new domain is instantly active!

Step 3: Update WordPress Site URL & Database (Post-Change)

If your website is built on WordPress, changing the server domain alone is not enough; WordPress hard-codes the site URL in its database. To prevent redirection loops or stylesheet breaking, update your database as follows:

Option A: Quick Temporary Fix in wp-config.php

Open cPanel File Manager, locate public_html/wp-config.php, click Edit, and add these two lines above “/* That’s all, stop editing! */”:

define( 'WP_HOME', 'https://newdomain.com' );
define( 'WP_SITEURL', 'https://newdomain.com' );

Option B: Permanent Database Update via phpMyAdmin

  1. In cPanel, click on phpMyAdmin under Databases.
  2. Select your website’s database, then click on the wp_options table.
  3. Locate the siteurl and home rows (usually rows 1 and 2). Click Edit and replace olddomain.com with newdomain.com.

Step 4: Preserve SEO with a 301 Permanent Redirect

To avoid losing your existing Google rankings and backlinks from your old domain, set up a permanent 301 redirect. Add this code to the .htaccess file of your old domain:

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

Recommended Web Hosting Plans for Multiple Domains

Single Shared Hosting

Ideal for personal blogs, starter sites, and portfolios.

βœ“ 1 Website
βœ“ 10 GB Enterprise NVMe
βœ“ Unmetered Bandwidth
βœ“ Free SSL & cPanel

€0.97 /month

Deploy Single Plan β†’

Premium Shared Hosting

Max performance for web agencies and high-traffic portals.

βœ“ Unlimited Websites
βœ“ Unlimited NVMe SSD
βœ“ 3 CPU Cores & 6 GB RAM
βœ“ VIP 24/7 Support & Backups

€2.93 /month

Deploy Premium Plan β†’

Frequently Asked Questions (FAQ) : Changing Domain on Hosting

1. Will changing my primary domain delete my website files?

No. Your files stored in public_html and your MySQL databases remain completely untouched. Only the domain mapping in the server’s virtual host configuration is modified.

2. How long does the domain change take to take effect?

On the server side, the change is instant. However, because DNS nameservers must propagate globally, it typically takes 15 minutes to 2 hours for visitors worldwide to see the update.

3. What happens to my old email accounts?

When the primary domain changes, email accounts associated with that domain change to the new domain extension. You should recreate necessary forwarding rules or alias routes for the old domain.

Share this article:
RM

About Raj Mehto

Senior Infrastructure & Cloud Hosting Analyst at HeroHosty. Dedicated to conducting independent speed benchmarks, server hardware evaluations, and actionable hosting advice for Indian website owners.

πŸš€ Fast NVMe Web Hosting

Ready to Experience Lightning-Fast Website Speeds?

Deploy your website on HeroHosty's LiteSpeed NVMe servers starting at just β‚Ή69/month (on 3-year plan) with free cPanel, free SSL, and 24/7 instant WhatsApp support.

Explore HeroHosty Hosting Plans β†’