A DNS entry for domain already exists error

mvandemar

Well-Known Member
Jun 17, 2006
98
22
158
I set up a client's server using vps.domain.com, with ns1. and ns2.domain.com as the nameservers. He asked me to set up an actual cpanel so he can set up a site on the main domain, but when I try and do so I get the following error:

A DNS entry for "domain.com" already exists. You must remove this DNS entry from all servers in the DNS cluster to proceed.

It does exist, since it's what the server is using. I set up my own server the same way, and I don't recall running into this issue when I set up the cpanel for the main domain on that one. Any idea why I would be running into this on his server when I didn't on mine?

-Michael
 

mvandemar

Well-Known Member
Jun 17, 2006
98
22
158
Hi,

Are you trying to create cPanel account that is same as hostname?
Not exactly, no. The hostname is vps.domain.com, and the nameservers are ns1. and ns2.domain.com, as I mentioned in the initial post.

Can you check if the DNS zone is present for the domain that you are creating in the cPanel?
Yes, it is present, I am assuming it was added when I set the hostname and nameservers. My question is how can I now add a cpanel using that main domain.

-Michael
 

mvandemar

Well-Known Member
Jun 17, 2006
98
22
158
So looking further, I see when I go to Edit DNS Zone, that there is an entry for domain.com, where vps.domain.com is defined, and then two separate entries, one each for ns1. and ns2.domain.com. Would it be safe to rename the first record, which defines the SOA, to vps.domain.com, and remove the generic domain.com entries within that? Would that break anything, and would doing so allow me to then create the domain.com cpanel account?

-Michael
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,250
313
Houston
Hi @mvandemar


Technically, this shouldn't happen but in this instance can you try removing the entry for domain.com from the DNS zone then adding the domain again? Once the domain is added they should all be able to share the same DNS Zone file without issue.

Thanks!
 

mvandemar

Well-Known Member
Jun 17, 2006
98
22
158
Do you mean delete the zone altogether? If I do that will it mess up anything else, like the nameservers? This is what it looks like now (see attached). I already deleted the A record for domain.com from this zone. Can I rename the zone to vps.domain.com? Do you think that would mess anything up, and if I did do it do you think it would work?

-Michael
 

Attachments

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,250
313
Houston
Hi @mvandemar

No, that's not quite what I meant, I meant to remove the entry for domain.com only but it looks like the whole zone is named for domain.com

Is there an entry for domain.com in /etc/named.conf?
 

mvandemar

Well-Known Member
Jun 17, 2006
98
22
158
Yes, looks like this:

Code:
zone "domain.com" {
        type master;
        file "/var/named/domain.com.db";
};
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,250
313
Houston
Hi @mvandemar


In this instance here's how I was able to make this work:

1. Rename/move the dns zone file in my instance I did the following (just moved it to the /root dir):

Code:
mv /var/named/domain.com.db /root/
2. rebuild the dns configuration

Code:
/scripts/rebuilddnsconfig
3. Confirmed after rebuild that the domain.com entry no longer existed in the named.conf as well as in /var/named/

4. Readded domain.


In your case, you'll most likely want to copy some or all of the entries from the previous DNS zone file to the newly created zone file.


Thanks!
 

mvandemar

Well-Known Member
Jun 17, 2006
98
22
158
Now I am getting this:

Code:
Account Creation Status: failed

(XID 37spbu) “nobody” already controls the domain name “www.domain.com”.
I went into /var/named and grepped for www\.domain\.com but nothing came back. Any ideas?

Edit: I found a solution. The /var/cpanel/users/system file had an entry that looked like this:

DNS1=domain.com

I edited that out, ran /scripts/updateuserdomains, and was able to add the cpanel in. Thanks!

-Michael
 
Last edited: