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
-
Connect to the server using RDP.
- Put the list of the domains into a file:
C:> “%plesk_bin%dbclient.exe” –direct-sql –sql=”SELECT name FROM domains” > C:domains.txt
-
Execute the following command to update SOA records for domains in the C:domains.txt:
For PowerShell
PS foreach ($dom in get-content C:list.txt) {plesk bin dns –update-soa $dom -soa-ttl 7H; echo “$dom – finished”}
For command prompt
C:> for /f “tokens=*” %a in (C:domains.txt) do ( “%plesk_dir%bindns.exe” –update-soa %a -soa-ttl 7H && echo Update of domain %a finished)
Check the following documentation for the details about –update-soa parameters on Windows