Changing the main domain of your hosting account and attaching another domain
PrintIn short: you can attach another domain yourself in cPanel, under Domains, and most of the time that is all you need: the website and the e-mail can run on the new name without touching the main domain. The main domain of the account, the one the plan was ordered with, cannot be changed from cPanel: our support team changes it at your request.
The main domain and added domains
- The main domain is the one entered in the hosting order. cPanel shows it in the right-hand column, under General Information, in the Primary Domain row. The files of its website live in the
public_htmlfolder. You do not attach it separately: it is tied to the plan from the moment the plan is activated. - Added domains are all the others, which you add under Domains. An added domain can have its own folder (a separate website) or share the folder of the main domain (an alias: one website under two names). The types are explained in the article on adding a domain in cPanel.
Which option fits your case
| What you want | What to do |
|---|---|
| One more website on the same plan | Add the domain with its own folder |
| The same website should also open on a second domain | Add the domain as an alias, or set up a redirect to the main domain |
| Only e-mail addresses on a domain whose website is hosted elsewhere | Add the domain, then restore the DNS records of the website |
| The website moves to a new name and you keep the old domain too | Add the new domain as an alias and update the address in the website application |
| You are giving up the main domain, no longer own it, or want to move it to another hosting account | Ask support to change the main domain |
How to attach another domain to the plan
- Log in to cPanel. From the client area, open My Services and choose your hosting plan.
- In the Domains section, open Domains and click Create A New Domain.
- Type the name in the Domain field, without
www. For a separate website, clear Share document root and choose the folder. For an alias, leave the option ticked. Click Submit. - Point the domain to the hosting: the TopHost nameservers are
ns4.tophost.mdandns5.tophost.md. The steps are in the article on changing nameservers.
Changing the nameservers is not enough on its own. Until the domain is added in cPanel, the panel does not know it: it is not offered when you install WordPress, under Email Accounts or under Redirects. Once the domain is added and points to the hosting, the free SSL certificate is issued automatically.
If you get the message "A DNS entry already exists", read the article about that error.
If the domain has DNS records that must be kept
When a domain is added, cPanel creates a new DNS zone for it, with standard records that send the website and the e-mail to your TopHost hosting. If the website of the domain runs on another platform and the domain uses the TopHost nameservers, write down its current records first (A, CNAME, TXT, MX). After adding the domain, open Zone Editor, click Manage next to the domain and put the website records back. For e-mail with TopHost, leave the MX record the panel created. If the domain uses the nameservers of another provider, the records are changed there, not in Zone Editor. Guides: the A record and the MX record.
Changing the main domain: what to send us
Before you ask:
- the new domain must already be registered;
- download a backup of the account.
Open a ticket from the client account that holds the hosting and include:
- the cPanel username or the current main domain;
- the new main domain;
- what to do with the old domain: remove it from the hosting or keep it as an added domain;
- whether the old domain has e-mail addresses and whether you still need them;
- whether the new domain is already added to the account and what its folder contains.
Do not put any password in the ticket. Do not send a cancellation request for the plan in order to change the domain: a cancellation ends the service, and the account is deleted together with its files, databases and e-mail.
What changes and what stays
- Files and databases stay where they are. The new main domain shows the website from
public_html. - Login details: the cPanel username, the passwords and the database names stay the same.
- The old domain: if it is removed from the hosting, its website and e-mail addresses stop working here. If it stays as an added domain, it keeps working.
- E-mail is tied to the domain name. An address
name@old-domaindoes not turn intoname@new-domainby itself. You create the addresses on the new name under Email Accounts (see how to create an e-mail address) and set them up again in your mail programs. If you need the old messages in the new mailboxes, tell us in the ticket. - Subdomains of the old domain keep their old names. On the new domain you create them again.
- DNS and SSL: the new domain must use the TopHost nameservers. The SSL certificate is then issued automatically (see AutoSSL).
Update the address in the website application
WordPress and other applications keep their own address in their settings. After the change, the website may jump to the old domain or show up without styles. In WordPress, open Settings, then General, and type the new address in the WordPress Address (URL) and Site Address (URL) fields. If the WordPress dashboard no longer opens, the same values are in the database: in phpMyAdmin, table wp_options (the prefix may differ), rows siteurl and home. Links inside pages may still carry the old address, so check them and clear the cache.
If something does not work
- The new domain does not open the website: the nameservers were not changed, or the change has not spread yet. It usually takes a few hours, sometimes 24 to 48 hours.
- The browser warns about the certificate: the certificate is issued only after the domain points to the hosting. Check under SSL/TLS Status.
- No mail arrives at the new addresses: the mailboxes were not created, or the MX record points somewhere else.
Could not find the cause? Write to us in a ticket with the domain, the cPanel username, the exact error text and the time it appeared. We do not need your password.