Plesk

How to change TTL value for SOA records on all domains on Plesk server?

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

  1. Connect to the server using SSH.

  2. 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

  3. 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

  1. Log into the server via RDP.

  2. Start a command prompt as an administrator.

  3. Create a backup for psa database:

    C:> plesk db dump psa > C:psa.sql

  4. Verify that C:psa.sql was created physically

  5. Generate a list of all domains to C:domains.txt file:

    C:> plesk db -Ne "select name from domains;" >  C:domains.txt

  6.  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

Exit mobile version