DNS template contains a record, f.e.:
webmail.<domain>. CNAME <domain>.
The record is changed as follows:
webmail.<domain>. A <ip.webmail>
DNS template changes were applied, but were not propagated to the actual zones. New subscriptions have the old records as well.
Relations between DNS zones and template were broken for the particular record ID.
Remove the record from the template, and re-create it again as desired.
To fix the existing domains, use the below command:
mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -Ne"select d.name,ip.IP_Address from domains d join DomainServices ds on ds.dom_id=d.id and ds.type='web' join IpAddressesCollections ipc on ds.ipCollectionId=ipc.ipCollectionId join IP_Addresses ip on ip.id=ipc.ipAddressId"|while read dom ip;do /usr/local/psa/bin/dns -res $dom -ip $ip;done
It will re-built all the zones from template one by one and generate correct records.