cyberpanel icon indicating copy to clipboard operation
cyberpanel copied to clipboard

[BUG] Can not have 2 of the same A and AAAA records

Open Simbaclaws opened this issue 2 years ago • 1 comments

Describe the bug Sometimes you want to be able to have the ability to set 2 ip addresses to a single A or AAAA record. A use case would be: you have a mail server that has 4 ip addresses all with PTR records pointing to mail.yourdomain.com, 2 ip addresses (IPv4 and IPv6) are used for your first nameserver: ns1.yourdomain.com, the other 2 ip addresses also (IPv4 and IPv6) will point to your second nameserver: ns2.yourdomain.com... Now the issue here is that cyberpanel only allows you to set 1 A or AAAA record for mail.yourdomain.com. Which means you can not have a forward record pointing to your PTR record because either one of the two nameservers can not be used.

A working example would be:

dig +short A one.one.one.one
1.0.0.1
1.1.1.1

dig +short AAAA one.one.one.one
2606:4700:4700::1001
2606:4700:4700::1111

In cyberpanel, the ability to add 2 ip addresses to a single A or AAAA record does not yet exist. (Or maybe it does but I don't know how to use it?) Which means half of the time (whenever my mail server tries to use ns2.yourdomain.com) my mail will not be delivered. Because I could only set it to the ip addresses of ns1.yourdomain.com

To Reproduce What steps did you take when the issue occurred?

  1. Add/Delete DNS Record
  2. Create A or AAAA record for the same domain + subdomain that you have already entered
  3. The interface says that the record was added successfully, but the record wasn't added and it doesn't show up a second time in the interface either.

Expected behavior Whenever I add a second A or AAAA record for the same subdomain + domain combination that I have already used. I expect the record to be added to the same A or AAAA record and be able to view it in the interface of cyberpanel.

Operating system: Ubuntu 20.04 LTS

CyberPanel version: Any version

Additional context This is causing major issues on one of my servers where I have such a setup... Half of my email is not being send because of this. I'm currently trying to figure out what cyberpanel does in the server side to see how I can add a second IP to the same A or AAAA record in order to solve my issue.

Simbaclaws avatar Aug 01 '22 19:08 Simbaclaws

For now I solved it using PowerDNS's pdnsutil command line utility to add a second A or AAAA address to my subdomain record like so: pdnsutil add-record yourdomain.com mail A 1.1.1.1 Obviously replace with your own domain and IPv4... pdnsutil add-record yourdomain.com mail AAAA 2606:4700:4700::1111 Obviously replace with your own domain and IPv6...

In my case these would be the second nameserver IP's.... At the end you obviously have to do: systemctl restart pdns (I ran these commands as root)

Now whenever I dig my mail.yourdomain.com I see 2 addresses for my A record as well as for my AAAA record.

It would be nice to have this capability in cyberpanel. For now I'll use the command line interface to get this to work.

It would also be nice to create a little tutorial for people having the same issue.

Simbaclaws avatar Aug 08 '22 11:08 Simbaclaws