Changing the Primary Server Domain (Best Practise Guidance)

Operating System & Version
CentOS 7.8
cPanel & WHM Version
WHM 90.0.5

martin MHC

Well-Known Member
Sep 14, 2016
345
75
78
UK
cPanel Access Level
Root Administrator
Hello

I have a request that I have been looking at for some time and want to ask for the best method to resolve.

- There is a server running WHM V90 on the primary domain -- domainP.com
- The server is full of other accounts on their own domains (and obviously an account for domainP as well but that's unused.
- MOST (but not all) email connections (IMAP/SMTP etc) on the server run through mail.clientdomain.org and NOT the main server domain.

It has come to light that it would be best from a business point of view to change the address of the primary domain - the domain that WHM itself runs on; such as domainP.com:2087 for a hypothetical root browser login.

this should be changed to NewDomain.org so that the above hypothetical scenario the root browser access to WHM could be NewDomain.org:2087 to reach the same WHM control panel.

(please note root access is turned off this is simply illustratory to show the domain we're discussing).

- What are the best practise steps for doing this transfer?
- Is this transfer advisable or would CPanel advise AGAINST this action?
- The domain (domainP.com acts as a nameserver (ns1.domainP.com, etc.) for all accounts on the server (I would imagine this DNS would all need updating).
- What other less obvious parts of the server setup would need adjusting to correctly use the new domain name post-change?

I have it from looking into this 2 years ago that it's potentially liable for messups and as these are live client accounts we've put off doing this, however I'm curious if we could do this and how it could be done.

The only alternative approach would be to buy a new server with the correct domain name and transfer all accounts across to the new server before dropping the old one. but this seems like a big effort simply to change the domain name the server is hosted on.

Any advice welcome.

P.s> I have looked at similar question titles on here but they're not on the same topic and often relate to cpanel access or subdomains, neither of which are issues in our case.
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
You mean you'd like to change the hostname of the server? Meaning the hostname is set to something like server.domain.tld and you've based the nameservers off this? It's a fairly normal occurrent to change the hostname which can be done by going to WHM>>Networking Setup>>Change Hostname

If you're wanting to change IP addresses for the hostname you'd want to use the IP address migration tool IP Migration Wizard | cPanel & WHM Documentation
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Hello,

In that case the first portion would be what you'd want to do WHM>>Networking Setup>>Change Hostname once you've ensured the new hostname resolves to the server.
 

martin MHC

Well-Known Member
Sep 14, 2016
345
75
78
UK
cPanel Access Level
Root Administrator
Hello
I have changed the hostname, and that's worked well (aside from turning off OSCP security on the browser while waiting for the certificate to activate) , however do I now need to manually update each DNS record with the new nameservers? ns1.oldsite.co.uk --> ns1.newsite.co.uk /etc .

I may not of clarified the intention originally, I apologise for that, but in changing the host site domain I need to change the name server references from the old domain to the new domain. Is there any automation possible for this? I didn't read anything about it in the documentation.... ?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
I may not of clarified the intention originally, I apologise for that, but in changing the host site domain I need to change the name server references from the old domain to the new domain. Is there any automation possible for this? I didn't read anything about it in the documentation.... ?
I am sorry for not getting back to you sooner, there, as far as I am aware not any automation for changing the nameservers, what is set for the domains would need to be changed at the registrar and that isn't something that's modifiable by you (unless you own the domain) or by cPanel at all