Question
At the moment, multiple DNS A records for one or several domains in Domains > example.com > DNS Settings are set to IP address 203.0.113.2. How to automatically update all of them to the new IP address 203.0.113.3?
Answer
-
Connect to the server:
- Plesk for Linux: Log in to the server via SSH
-
Plesk for Windows: Log in to the server via RDP and start the command prompt
-
Create a backup of
database:
psa# plesk db dump psa > psa_backup.sql
Note: additional information about backup creation can be found in this article.
-
Update the A records to a new IP address (in this example, 203.0.113.2 is the current IP address, and 203.0.113.3 is the new one - replace them with actual values):
-
For a specific domain, e.g. example.com:
# plesk db "update dns_recs set val='203.0.113.3', displayVal='203.0.113.3' where host like '%example.com%' and type='A' and displayVal='203.0.113.2';"
-
For all domains on the server:
# plesk db "update dns_recs set val='203.0.113.3', displayVal='203.0.113.3' where type='A' and displayVal='203.0.113.2';"
-
-
Use the
plesk repair dns
utility to update DNS configuration files:# plesk repair dns -y