Symptoms
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
Description
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.
Workaround
Remove the record on the line given in the DNS zone. The zone will not be loaded until the record is removed.
- Log into the server via SSH
- Open the domain's DNS zone via your favorite text editor, such as nano:
nano /var/named/domain.tld.db
- Place a semi-colon ( ; ) at the beginning of the line in question to comment out the duplicated DNS record
- Increase the serial number line by 1.
- Confirm the DNS zone is valid by the following command:
named-checkzone domain.tld /var/named/domain.tld.db
- Reload the server via the command below:
rndc reload