Edit DNS zones from Child Domains

At this moment you cannot edit dns zone froms child domains, like if you have domain qwerty.com and a child domain abc.com, you cannot create a DNS for 123.abc.com.

I am currently having the same problem I am trying to add an MX record in a Child Domains and it does not let me do not leave the domain in the box to change the records, did you manage to do it?

Investigating the same problem here. It seems:

  • DNS zones are only editable for domains which are a website’s main domain, child domains don’t show up in editable/deletable DNS zones.
  • When trying to manually add zones in CyberPanel, it shows error : “Cannot create DNS Zone. Error message: (1062, “Duplicate entry ‘<domain.name>’ for key ‘name’”)”.

I just tried this, but I get the same error.

  1. Deleting the child domain
  2. Adding the zone manually (doesn’t work)
  3. Re-creating the child domain

So it also seems:

  • CyberPanel doesn’t clean up DNS data left behind when deleting a domain.

Testing with a new (imaginary) domain:

  1. Creating the zone manually first (success message, but actually fails)
  2. Adding domain as child domain
  • Adding the domain first show a success message, but the domain doesn’t show up as editable/deletable, so there’s no point of moving to step 2.
  • Subsequent tries to re-add the domain shows the same “Duplicate entry” error message as above.
  • We now know that “cleaning up” old DNS data left behind won’t solve our problem.

So now I find myself poking my dirty fingers inside CyberPanel’s database.

  • In Database > PHPMyAdmin, DB ‘cyberpanel’, we find THREE relevant tables : ‘domains’, ‘e_domains’ and ‘websiteFunctions_websites’
  • Table ‘domains’ has more domains than available as editable/deletable zones – but it’s not consistant with the domains that fail to be manually created (some are there, some are missing – for instance my imaginary domain doesn’t show up here)
  • Table ‘e_domains’ almost perfectly matches the editable/deletable domains (one is missing from the table…)
  • Table ‘websiteFunctions_websites’ matches perfectly the list of editable/deletable domains (even the ordrer)!

And that just makes me realize that the list of editable/deletable zones is a perfect match of CyberPanel’s list of actual websites. No more, no less, same ordering (oldest first).

Conclusion: the only way to edit the DNS zones of a domain in CyberPanel is to use it as the main domain for an actual website. There is no way to edit zones for add-on domains.

Then:

  • What’s the point of the “Create DNS Zone” function, if you can’t edit the created zone?

@biguenique So does that mean, if there is a child domain with unwanted dns entries ( I have A records with blank values which I want to remove), we would need to convert it to main website first and then remove? I guess there are still some hidden entries in dns zones. @usmannasir can you help in telling how to cleanup dns entries of child domains?

Has there been a solution or update to this issue?
I am trying to add some records for child domains and am unable to find a way to do it.

  1. primary domain using NS to your server or other DNS hosting like namecheap cloudflare etc

  2. You have 2 choices to use child domain:
    2.1. create new website
    2.2. create domain inside primary domain

please answer number 1 and 2
i hope i can help you understand how to manage NS rather than just asking you do this, do that, and you still not understand how it work

Thanks for the quick reply.

I have a primary website using the NS (ns1.domain.com, ns2.domain.com) that cyberpanel manages. That’s working fine. I can add/remove dns records for that website.

I would like to put child domains under that primary website and still be able to add/delete dns records for that child domain.

So, I am asking about 2.2 create domain inside primary domain, and still be able to add/delete dns records for that child domain.

you want to try add zone record only or with website
if with website you can use add domain
if you want just add
subdomain.domain.tld IN A to other server
just go to :8090/dns/addDeleteDNSRecords
image

if you want to add your-free-sub.eu.org
try this trick

add primary eu.org :smiley:
then point subdomain.eu.org IN NS to your cyberpanel DNS
then add domain :smiley:

Yes, that part is working fine. There is no problem there with adding websites and child domains. The part where there is a problem is (for example), when I want to add MX records for a child domain so that a client can use a Google Workspace email with their child domain.

I will explain some background on my situation and maybe it will make more sense. (Note: the forum was not letting me post my reply with more than 2 links, so I replaced all the ‘dots’ with ‘commas’ so that they don’t show up as links. For example, child1.com was changed to child1,com)

I have clients using my server to host their websites. Some clients have more than one website. I am using CyberPanel’s “Packages” feature to manage the client’s storage, website and bandwidth usage. Since CyberPanel’s “Packages” are attached/assigned to websites at the upper “website” level, clients sign up using a primary/parent domain (for example… parent,com). Then, all additional websites they want to add are added as child domains (for example… child1,com, child2,com, or even subdomain,parent,com etc).

Clients are only allowed 1 website at the upper “website” level, because the “Package” feature is able to keep track and limit how much storage, band width and child domains they are using based on the one website and its many child domains. I believe I am using the “Packages” feature correctly. Many other web hosts work similarly where you sign up with a primary parent domain… then when you add additional domains, they are organized as child sites beneath that parent domain.

So, adding the parent website and child domain websites is not a problem. That all works fine. Also, adding MX entries to the parent website works fine. (for example, if the client wanted to set MX entries of parent,com to use Google Workspace for their info@parent,com email, that works fine.

BUT, the problem comes when they want to also add Google Workspace email for their other child sites like info@child1,com or user@child2,com. I am unable to add MX entries to those child websites to enable Google Workspace to work with their child domains.

I understand that I can get around this by adding their child domains as ‘upper level’ websites, on the same level as the parent,com domain. However, since the “Package” feature keeps track of storage, bandwidth, etc based on the website the package is assigned to, plus all of its child domains, I would lose the ability to track the client’s usage. If I add the child1,com domain as an ‘upper level’ website, I would need to assign a second “Package” to that child1,com.

I hope this makes sense. Let me know if something is unclear.

ok, i 99.99999% understand the situation

this is your main problem… isnt it?..
i was experiment about this few weeks ago


there is no problem occurs with those MX record…

you mean your user ?
if so… well i never try about that.
wait a min… i will try create package for user :smiley:
i use this vps for testing purpose and never use user account lol

add the DNS Zone manually
:8090/dns/createDNSZone
then go to client account edit the DNS Zone from their login
but before that you must create or edit user ACL checklist the add/remove edit NS
image

i hope im not miss understand

If you look up the MX entries of the 3 domains you have there:

  • belanja,eu,org
  • dodol,eu,org
  • eu,org
    Using this site: Network Tools: DNS,IP,Email
    It shows that belanja and eu have different MX entries, but dodol has no MX entries:
  • belanja shows improvmx,com entries
  • eu,org shows smtp,eu,org entries
  • dodol shows no MX entries

Where did you set the MX entries for blenanja,eu,org and eu,org?

eu.org is not mine… eu.org is free subdomain provider

for that example (that you mention) they still use internal MX
but before that. i was point the MX to my CWP server (external MX record)

that is only simulation not active domain…
dodol = not my subdomain either
i just use a simple name to test add subdomain and some experiment

When adding child domains, some clients are not just adding subdomains of their parent site, although they may have a mix of other domains and subdomains of the parent. For example, their account website structure might be like this:

parent,com (parent website)

  • child1,com
  • child2,com
  • subdomain1,parent,com
  • subdomain2,parent,com
  • other-name,com

For any of the child domains, especially the ones that are not subdomains of the parent, how can I set the MX entries for those, or also other TXT entries?
For example, how can we set the MX entries and TXT entries for other-name,com?

(I am heading to sleep now. I will check back in the morning. Thank you for your replies. I appreciate it)

try to create new package
it’s more easier if use new package

Ok, I did that.
I logged in as client user, I go to DNS > Add/Delete Records.
The only domain I can select is their parent website domain.
If I go to add a DNS zone that matches any of their child domains, it says that it cannot create it because there is already a DNS zone that exists for that child domain.
But when I go to DNS > Add/Delete Records, I am unable to select that child domain. Only the parent website domain shows up.

did you already add domain for those child ?

Yes, the website for child domains is installed and up and running.

this is what i think about the cyberpanel “link-tree error” need new restructure (cc to mr @usmannasir )

ok back to your question

you cant edit NS if you add as a domain. you should edit/add manually from website’s NS zone

I’m not sure what you mean by this. By “edit NS”, you are referring to adding DNS entries like MX and TXT?

By “edit/add manually from website’s NS zone”, do you mean add DNS entries for the child domains by going to the parent website’s DNS entry page and add child domain entries there in the same list?