Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How can one update the IP address in multiple Plesk DNS A records at once?
Answer
-
Connect to the server over SSH
-
Back up the Plesk database
# plesk db dump psa > psa_pre_ip_update_backup_$(date +%F-%T).sql
-
Use one of these commands to update the records
Note: In this example,
203.0.113.2
is the current IP address, and203.0.113.3
is the new one. Replace them with the real ones.-
For one domain
# 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'"
-
-
Update the DNS configuration files with the repair utility
# plesk repair dns -y
-
Connect to the server over RDP
-
Start a Command Prompt or PowerShell terminal
-
Back up the Plesk database
PS plesk db dump psa > psa_pre_ip_update_backup.sql
-
Use one of these commands to update the records
Note: In this example, 203.0.113.2 is the current IP address, and 203.0.113.3 is the new one. Replace them with the real ones.
-
For a specific domain
PS 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
PS 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'"
-
-
Update the DNS configuration files with the repair utility
PS plesk repair dns -y
Comments
0 comments
Please sign in to leave a comment.