Backup dns: don't remove sole record if it's a linked IP

Version 1.52


Say you have a domain on, and you have linked to it for dns, DA will duplicate all A/AAAA records accordingly. So you'd have: www A www A however, some people might manually change the ns1/ns2 records to look like this: ns1 A ns2 A while the other records are doubled up. When DA creates the backup, it will remove the linkeds IPs from the zone, leaving just: www A ns1 A where this would actually cause the write to fail the zone write check, since if this was present: NS ns2 the ns2 A record is now missing. This change is to check how many total A+AAAA records there are for that given name, and if there is only 1, then the value is not removed. This can span AAAA records too, eg: ns1 A ns2 AAAA :::1:2:3:5 and DA will ensure if there is only 1 of either A or AAAA, that last value is not removed, even if it's only on the linked IP. This will allow it to pass the zone check. Backups will now also include the domains/, so that DA can eventually be coded to know that the value is an additional value, and should be swapped if the new server is using a different IP. As this change currently sits, when you restore the zone, if you were to set the User/Domain to use, it would end up like: www A ns1 A ns2 A Since is considered a "custom" IP at this point, since DA does not yet check that it's a linked IP (as the backup system only currently supports a single IP to restore to) If you're restoring to the same IPs, then it should be fine, it just gets a bit messy if you're restore to a different IP, then would need to be swapped accordingly after the restore.

Interested to try DirectAdmin? Get a 30-day Free Trial!