Attempting to add new DNS records to a given DNS zone results in errors similar to the following:
Error: API failure: Zone is invalid: Line XX: ignoring out-of-zone data (domain.tld) at /usr/local/cpanel/Cpanel/ZoneFile/LineEdit.pm line 390
DNS zones can only hold records for the domain the zone is for. Attempting to add records for a different domain will result in the above error. The error references the line with the issue and gives a hint as to what the referenced domain is.
Remove the record on the line given in the DNS zone. The zone will not be loaded until the record is removed.
1. Log into the server via SSH
2. Open the domain's DNS zone via your favorite text editor, such as nano:
3. Place a semi-colon ( ; ) at the beginning of the line in question to comment out the duplicated DNS record
4. Increase the serial number line by 1.
5. Confirm the DNS zone is valid by the following command:
named-checkzone domain.tld /var/named/domain.tld.db
6. Reload the server via the command below: