• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

DNS Zone - Serial prbl -> solutions ?

R

romino

Guest
As you know, Plesk 8 doesn't create a correct serial number for zone files, wich can be a problem for .fr and .de tld's.

Plesk sent me a code that could resolve the problem.
What is your opinion on it? I didn't test it .... not wanting to have problem with my current sites ...

Here is the code:

----
#!/bin/sh
#Change directory to named's root/var
cd `awk '/^NAMED_RUN_ROOT_D/{print $2}' /etc/psa/psa.conf`/var

#Get active DNS zones (echo...|mysql...)
#Change all zone files inline (|xargs -r perl...-i)
echo 'SELECT `Z`.`name` FROM `domains` `D`, `dns_zone` `Z` WHERE\
`D`.`dns_zone_id`=`Z`.`id` AND `Z`.`type`="master" AND `D`.`status`=0;'\
| mysql -Nb -uadmin -p`cat /etc/psa/.psa.shadow` psa\
| xargs -r perl -pe '$_ =~ s~^(\s+)([^2]\d+)(\s+;\s+Serial.*)$~$1.(@a=localtime $2, sprintf("%04d%02d%02d%02d", $a[5]+1900, $a[4]+1, $a[3], ($a[2]*60+$a[1])/96)).$3~e;' -i

#Force named to reload its configuration and zones
/usr/sbin/rndc reload

#End of script
----
 
Back
Top