• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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