Question
It is required to change SOA record value (TTL) for all domains hosted in Plesk. How to do it in bulk for all domains?
Answer
Note: the further instructions are intended for server administrators with direct RDP/SSH access to the server. If direct SSH/RDP access to the server is not possible, contact server administrator for further assistance.
Click on a section to expand
For Linux
-
Connect to the server using SSH.
-
Create Plesk database backup and perform the update:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin psa > /root/psa_db_backup`date +%F`.sql
-
Execute the following script to update SOA for all domains:
# sudo plesk bin domain --list | xargs -I {} sudo plesk bin dns --update-soa {} -soa-ttl 1D -soa-refresh 3H -soa-retry 1H -soa-expire 7D -soa-minimum 3H -soa-serial-format yyyymmddnn
Check the following documentation for the details about --update-soa parameters on Linux
For Windows
-
Log into the server via RDP.
-
Create a backup for psa database:
C:> plesk db dump psa > C:psa.sql
-
Verify that
C:psa.sql
was created physically -
Generate a list of all domains to
C:domains.txt
file:C:> plesk db -Ne "select name from domains;" > C:domains.txt
-
Run the command below to set TTL as 5 minutes for all domains from the C:domains.txt file:
C:> for /f "tokens=*" %d in ('type C:domains.txt') do plesk bin dns --update-soa %d -soa-ttl 5M
Check the following documentation for the details about --update-soa parameters on Windows