Re: [Pdns-users] Domain serial with Postgres backend

2008-08-30 Thread James Cloos
 Mitchell == Mitchell Smith [EMAIL PROTECTED] writes:

Mitchell In my SOA records I am specifying the serial as 0, which according to 
the
Mitchell documentation will cause PowerDNS to generate a serial for the domain 
based
Mitchell on the changed_date of the records.

That doesn't work with the generic sql backend.

You have to do it in the sql.

I'd use a view rather than a table for records.  Have it grab the values
from one or more backend tables for everything other than SOA RRs, and
create SOA RR rows from the data in the domains table (which should be
extended to include everything in an SOA other than serial) and the
largest changed_date column from that domain's RRs.

Something akin to:

 SELECT rr.content, rr.ttl, rr.prio, rr.type, rr.domain_id, rr.name
   FROM rr
  WHERE rr.type::text  'SOA'::text
UNION 
 SELECT domains.soa_host || ' '::text || domains.soa_email || ' '::text ||
domains.serial AS content, domains.default_ttl AS ttl,
NULL AS prio, 'SOA' AS type, domains.id AS domain_id, domains.name
   FROM domains;

(which I grabbed from some old notes; obviously domains.serial needs to
be replaced with GREATEST and a join).

-JimC
-- 
James Cloos [EMAIL PROTECTED] OpenPGP: 1024D/ED7DAEA6
___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users


Re: [Pdns-users] Domain serial with Postgres backend

2008-08-24 Thread Mitchell Smith

Did you make a change resulting in a modified changed-date after you
changed the query to include the field? Without such change there is
little reason to change the serial.


Yes, I did update a couple of records on the zone so it should have a new 
serial.



___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users


Re: [Pdns-users] Domain serial with Postgres backend

2008-08-22 Thread Hugo van der Kooij
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mitchell Smith wrote:

 I added changed_date as a 7th field, hoping that it was an optional
 argument; however the serial for my zones is still stuck on 0.

Did you make a change resulting in a modified changed-date after you
changed the query to include the field? Without such change there is
little reason to change the serial.

Hugo.

- --
[EMAIL PROTECTED]   http://hugo.vanderkooij.org/
PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc

A: Yes.
Q: Are you sure?
A: Because it reverses the logical flow of conversation.
Q: Why is top posting frowned upon?

Bored? Click on http://spamornot.org/ and rate those images.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFIrlefBvzDRVjxmYERAmCeAJ0ROp8glq2gcqI00+F25UgZy9rGZwCaApOT
AWtEubu1t5E721pXGkKLIAo=
=q1J9
-END PGP SIGNATURE-
___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users


[Pdns-users] Domain serial with Postgres backend

2008-08-21 Thread Mitchell Smith

Greetings,

I am having a minor problem with PowerDNS with the Postgres backend.

Before I get in to the issue, I should probably point out that our schema
has been somewhat customized, and the pdns.conf file contains a number of
queries to retrieve the data in the format that PowerDNS is expecting.

For the most part this appears to be working well, and I can query PowerDNS
from the command line and get the results I am expecting back.

The issue I am having is with the SOA record, more specifically the serial
number.

In my SOA records I am specifying the serial as 0, which according to the
documentation will cause PowerDNS to generate a serial for the domain based
on the changed_date of the records.

Upon reviewing this documentation, I noticed that the custom queries were
not retrieving the value for changed_date, as this was not one of the 6
values required by the gpgsql-basic-query as outlined in the documentation.

I added changed_date as a 7th field, hoping that it was an optional
argument; however the serial for my zones is still stuck on 0.

I am hoping that someone on the list has come across this issue before, and
has a solution to providing the changed_date on custom queries, so that the
serial for the zone is correctly calculated.

Any feedback on this issue would be very much appreciated.

Thanks


___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users