Create account using existing DNS and email addresses

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
In the course of solving problems for a client, things have evolved. An account has NOT been created at this point.

Originally, I added a DNS zone with some custom settings. Life was good.

Then I added email accounts to this zone using Configserver's CMM script. Life was good. (so much time had passed between adding the DNS zone and adding the email addresses that I didn't remember or realize I wasn't working with a full account.

I decided I'd better evaluate the space being used by this domain... THAT is when I realized I'd never created an account!

So, now I have an existing DNS zone with custom entries for WWW, MX records, etc. that also has a dozen or more email accounts, forwards, etc.

Is it possible to create an account and KEEP, NOT OVERWRITE the DNS zone and email addresses? Or am I looking at documenting everything and recreating it as fast as possible as a proper account?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
Hello :)

I suggest backing up the DNS zone, removing it, creating the account, and then restoring the zone or modifying it to add the custom entries. You should backup the email data, re-create the email accounts, and then move any stored email to the appropriate directories (e.g. /home/$user/$mail/$domain) after account creation.

Thank you.
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
Hello :)

... backing up the DNS zone, removing it, creating the account, and then restoring the zone or modifying it to add the custom entries.
I manually copied the /var/named/domain.com.db file to a backup location, removed the zone, created the account, renamed the newly created domain.com.db to domain.com.db.bak and then copied the original zone file back. Permissions and ownership were adjusted as neccessary.

named was restarted with no failures. If I do an nslookup on the domain using the local server, information is returned correctly.

If I go to edit the DNS zone, however, all of the information is blank as when new... A records, CNAMES, TTL... it's all as if the account was brand new. Did I miss something?
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
Update:

I have a small cluster with one additional DNSonly cpanel server.

After making the original changes, I also sync'd the DNS cluster, but the changes didn't make it to the DNSonly box. So, I manually removed the zone from the DNSonly box, then forced a sync. NOW all the zone info is appearing correctly.

Bug? Or ???
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
It's not a bug, but rather the other zone likely had a newer serial. It's important to update the serial when restoring a zone file:

Update Serial DNS Zone

Thank you.