• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Change all domains TTL

Chris1

Regular Pleskian
Hello,

I'd like to change all domains TTL, when I try to change the DNS template it doesn't seem to change every domains TTL, not sure why?

I saw this: http://kb.odin.com/en/120025

I notice that there are two values I probably need to change: ttl='900', ttl_unit='60'

What does this mean exactly? What is the difference between the ttl and ttl_unit?
 
TTL is value, TTL_UNIT is measure - sec/min/hours/...
 
Hi Igor,

Thanks for that. So in the above example what does the 60 and 900 mean?

Would this script work on both Plesk 10 and 12?
 
900 and 60 means 900 minutes.
Yes, I think it should work for both versions.
 
This is the script we use prior to moving sites between servers to lower the TTL

3600S = 3600 seconds = 1 hour

uncomment the $domdone you want to test what will be done or to actualy do it

<?php

$pwfile = "/etc/psa/.psa.shadow";

$pw = trim(file_get_contents($pwfile));

mysql_connect("localhost","admin", $pw);
mysql_select_db("psa");

if (!($resdoms=mysql_query("select name from dns_zone where status = '0' ORDER by name;"))) {
print("MySQL error: " . mysql_error());
}

$aantal = mysql_num_rows($resdoms);
echo "$aantal domains found ... Starting domains\n";
for ($r = 0; $r < mysql_num_rows( $resdoms); $r++) {
$row = mysql_fetch_array ($resdoms);
//$domdone = "would do /usr/local/psa/bin/dns --update-soa $row[0] -soa-ttl 3600S\n";
$domdone = shell_exec("/usr/local/psa/bin/dns --update-soa $row[0] -soa-ttl 3600S");
echo "$domdone";
}

?>

There is a lot more you can adjust with the dns utility
exented documentation is here

http://download1.parallels.com/Plesk/PP12/12.0/Doc/en-US/online/plesk-unix-cli/37771.htm#

hope this helps

regards
Jan
 
Thank you, much appreciated!

Just a question though, why doesn't the TTL get changed for all domains when you do it via the GUI? "Tools & Settings" > "DNS Template" > "SOA Records Template"

Some domains TTL change but some don't?
 
Back
Top