[Pdns-users] Auto SOA record serial

Cosimo Streppone cosimo at streppone.it
Tue Dec 6 21:51:16 UTC 2011


On Tue, 06 Dec 2011 16:30:33 +0100, Nick Douma <n.douma at nekoconeko.nl>  
wrote:

> According to the docs, if I use the value 0 in place of the serial value
> in the content of a SOA record, PowerDNS should retrieve the highest
> change_date of all the records in that zone and use that as serial. My
> record looks as follows:
>
> example.com SOA ns1.example.net webmaster.example.net 0 16384 2048
> 1048576 900
>
> When I retrieve the record using dig, I see:
>
> $ host -t SOA example.com
> oppai.nl has SOA record ns1.example.net webmaster.example.net 0 16384
> 2048 1048576 900

By any chance, are you using the pipe backend?

I remember having the same problem because my pipe backend script
would return the incorrect record format for a SOA query.

This is the relevant fix in my code, FWIW:

      if ($return_any || $qtype eq 'SOA') {
          if (my $soa_rec = soa_lookup($qname, $config)) {
              # Transform our SOA record in the config to an RR as powerdns  
expects
-            my $soa_rr = [ $qname, $qclass, 'SOA', DEFAULT_SOA_TTL, -1,  
@{ $soa_rec } ];
+            my $soa_str = join ' ', @{ $soa_rec };
+            my $soa_rr = [ $qname, $qclass, 'SOA', DEFAULT_SOA_TTL, -1,  
$soa_str ];
              push @rr, $soa_rr;
          }
      }

Last part of the record was tab-delimited instead of space-delimited
as it should be.

-- 
Cosimo



More information about the Pdns-users mailing list