Delete DNS re-create DNS bug - affects cPanel and Email

rsaylor

Well-Known Member
Mar 27, 2003
160
1
168
Hi,

A user of mine had an issue with somehow deleting a DNS zone rendered his cpanel useless and the domain disapeared from the account list. Today I did the same and it is truely a bug.

WHM 10.8.0 cPanel 10.8.2-R119
CentOS 4.4 i686 - WHM X v3.1.0

Step 1: Create a domain is WHM

Step 2: Delete the DNS zone for that domain in WHM

Step 3: Login to cPanel for that domain and the following errors will be displayed in the x and x2 theme.

[an error occurred while processing this directive]
Sorry, your Cpanel Config file is missing your dns info. / unlimited

Step 4: Re-add the DNS zone (WHM > DNS Functions > Add A DNS Zone)
Type in the IP address and the domain name

Step 5: Refresh cpanel for said user, same error.

Sorry, your Cpanel Config file is missing your dns info. / unlimited

Step 6: Login SSH and modify the following:

vi /var/cpanel/users/someusername

where someusername is the user

Your file will look simular to this:

IP=66.151.72.2
STARTDATE=1158111696
RS=x
OWNER=root
PLAN=undefined
MAXPARK=0
MAXADDON=0
FEATURELIST=default
XDNS1=robertsaylor.com

Now, modify the file so it looks like this:

DSN=robertsaylor.com
IP=66.151.72.2
STARTDATE=1158111696
RS=x
OWNER=root
PLAN=undefined
MAXPARK=0
MAXADDON=0
FEATURELIST=default
XDNS1=robertsaylor.com

Save the file

Now run:

/scripts/updateuserdomains

Refresh cpanel for that user

error has been fixed.
 

freedman

Well-Known Member
Feb 13, 2005
314
5
168
there are several bugzilla reports on these and related problems.
I'd suggest you subscribe and vote for the ones you think would hlep solve your individual problems:

http://bugzilla.cpanel.net/show_bug.cgi?id=4665

http://bugzilla.cpanel.net/show_bug.cgi?id=4583

the problems are related sort of.

this particular problem is that cpanel removes the DNS entry from /usr/cpanel/users because it knows it's there when you do the remove.

However, when you readd the domain, it doesn't know what account to which it should be attached.

in cpanel's defense, how could they... it's possible you're removing the domain and then want to add it but for another hosting account? theoretically, if you're adding a domain, cpanel should ask you to which account it belongs, but I'm guessing it's just not something that's really been done.

partly because it's rare.. it's more likely you'll remove a subdomain or addon domain, rather than the main or only domain for a client.
in this case, I believe, when the customer logs into whm, all works, but then they have to add the subdomain, addon/parked domain, themselves also... the DNS work is done, but this would add it to their /var/cpanel/users file I think.