1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

DNS Zone - Serial prbl -> solutions ?

Discussion in 'Plesk for Linux - 8.x and Older' started by romino, Mar 14, 2007.

  1. romino

    romino Guest

    0
     
    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
    ----
     
Loading...