When adding a new DNS records in cPanel > Zone Editor there is an error:
Error: The DNS zone file is invalid. (Line 20: ignoring out-of-zone data (ns1.solutions.rs); Line 21: ignoring out-of-zone data (ns2.solutions.rs))
How to fix error
Check if the DNS zone is valid by running:
named-checkzone domain.com /var/named/domain.com.db
Output will show you which lines are causing the problem:
so now just edit the file and comment the lines (in my case 20 and 21) by adding a semi-colon at the beginning ( ; )
nano /var/named/domain.com.db
turn on line number display in nano with alt shift C
then navigate to the lines (in my case 20 and 21) and comment them:
exit with ctrl x then save with y
Now go back to cpanel and add/edit records that you wish.
Why did this happen?
The DNS zone can be corrupted for a variety of reasons; in my instance, the default zone templates were causing issues because my nameservers were on the same server and the template required that every new domain have the following records:
So I won’t have this problem with new domains if I just remove these records from the template.