• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

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