creating a cPanel account that already has DNS zone

ladydi711

Well-Known Member
Sep 4, 2001
140
6
318
Hi,

I host a DNS zone on my cPanel server that is not associated with a cPanel account.

I now have the need to have an account (it would be a subdomain.mydomain.com).

I do not want to inadvertently cause problems with the existing zone records.

What is the best way to accomplish this without risking unintended changes to the existing zone?

Thanks in Advance!
Diane
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
You can just make a backup of the DNS zone and then overwrite the newly created one after you add the subdomain.

Code:
# cp /var/named/domain.com.db /var/named/domain.com.db.bk
go into WHM and delete the zone, then go into cPanel and add the subdomain.
Code:
# cp -rf /var/named/domain.com.db.bk /var/named/domain.com.db 
# service named reload
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

Yes, as mentioned in the previous post, you can only do this by first backing up and removing the existing zone, followed by creating the account and copying over the saved zone.

Thank you.
 

ladydi711

Well-Known Member
Sep 4, 2001
140
6
318
Thanks, All!

I have noticed that the creation of a cPanel account creates some additional records that the current zone file will not have. Is there anything cPanel specific that I need to worry about/retain?

Thanks,
Diane
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
You can backup the zone that cPanel created before deleting it and then manually add those entries to the existing zone after copying it over.

Thank you.
 

ladydi711

Well-Known Member
Sep 4, 2001
140
6
318
I've followed these steps, but when I Edit the zone in WHM, it is displaying the entries from the version of the zone after the new account was created. What step am I missing?
 

ladydi711

Well-Known Member
Sep 4, 2001
140
6
318
Yes, unfortunately, that did not work. I opened a cPanel support ticket and they instructed me that because the serial number of the old zone was less than the serial of the new zone, it was only using the new zone. I manually had to add all the records needed from the old zone.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
I am happy to see the issue is now resolved. Thank you for updating us with the outcome.