Plesk

Can’t apply DNS template to a migrated domain in Plesk

Symptoms

Cause

In this case, the changes are applied to the DNS zone of a migrated domain. It is expected behavior according to the Plesk documentation, after restoration, migration, or upgrade, all zones are treated as user-modified.

The button Switch DNS is available only when migrating from Plesk servers.

Resolution

If you need to apply DNS template changes after an upgrade, restoration, or migration, choose the Apply DNS Template Changes option:

  1. Log in to Plesk
  2. Navigate to Tools & Settings > DNS Zone Template
  3. Choose the Apply DNS Template Changes option

Additional information

If only certain DNS records need to be adjusted for several domains, consider using the dns CLI utility:

1. Connect to the server via SSH

2. Create a text file with the list of the required domains with one domain per line (for example, domains.txt)

Alternatively, use the following command to output the list of all domains on the server into the file:

# plesk bin site --list > domains.txt

3. Remove the unwanted records for all domains listed in the file, e.g.:

# for i in `cat domains.txt`; do plesk bin dns -d $i -ns "" -nameserver "ns1.unwanted.server"; done

4. Add the required records, e.g.:

# for i in `cat domains.txt`; do plesk bin dns -a $i -ns "" -nameserver "ns1.required.server"; done