Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

A DNS entry for domain already exists error

Discussion in 'Bind/DNS/Nameserver' started by mvandemar, Aug 11, 2018.

  1. mvandemar

    mvandemar Well-Known Member

    Joined:
    Jun 17, 2006
    Messages:
    70
    Likes Received:
    1
    Trophy Points:
    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
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,880
    Likes Received:
    89
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Are you trying to create cPanel account that is same as hostname?
    Can you check if the DNS zone is present for the domain that you are creating in the cPanel?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mvandemar

    mvandemar Well-Known Member

    Joined:
    Jun 17, 2006
    Messages:
    70
    Likes Received:
    1
    Trophy Points:
    158
    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.

    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
     
  4. mvandemar

    mvandemar Well-Known Member

    Joined:
    Jun 17, 2006
    Messages:
    70
    Likes Received:
    1
    Trophy Points:
    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
     
  5. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. mvandemar

    mvandemar Well-Known Member

    Joined:
    Jun 17, 2006
    Messages:
    70
    Likes Received:
    1
    Trophy Points:
    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
     

    Attached Files:

  7. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. mvandemar

    mvandemar Well-Known Member

    Joined:
    Jun 17, 2006
    Messages:
    70
    Likes Received:
    1
    Trophy Points:
    158
    Yes, looks like this:

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

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. mvandemar

    mvandemar Well-Known Member

    Joined:
    Jun 17, 2006
    Messages:
    70
    Likes Received:
    1
    Trophy Points:
    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
     
    #10 mvandemar, Aug 15, 2018
    Last edited: Aug 15, 2018
  11. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,137
    Likes Received:
    223
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @mvandemar

    Yea, that was exactly the solution I would have suggested for that as well. I'm glad you got the domain added! Thanks for keeping us updated as well :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice