<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><HTML><head><META content="text/html; charset=utf-8" http-equiv="Content-Type">

<STYLE><!--         /* Style Definitions */         p.857b4b34-0510-4936-a728-222be3c1de38, li.857b4b34-0510-4936-a728-222be3c1de38, div.857b4b34-0510-4936-a728-222be3c1de38, table.857b4b34-0510-4936-a728-222be3c1de38Table         {margin:0cm;    margin-bottom:.0001pt;}        div.Section1        {page:Section1;}        --></STYLE>

  <META content="text/html; charset=utf-8" HTTP-EQUIV="Content-Type">
  <META CONTENT="GtkHTML/3.18.3" NAME="GENERATOR">
</head><BODY ALINK="#a32427" LINK="#a32427" VLINK="#a32427">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
<TBODY>
<TR>
<TD><A HREF="http://www.datanet.co.uk/default.aspx"><IMG ALT BORDER="0" NOSEND="1" SRC="http://www.datanet.co.uk/images/email_head.gif"></A></TD>
<TD ALIGN="right"><A HREF="http://www.datanet.co.uk/default.aspx"><IMG ALT BORDER="0" NOSEND="1" SRC="http://www.datanet.co.uk/images/logo_email.gif"></A></TD></TR></TBODY></TABLE>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"> </P>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38">
<HR COLOR="#cc3333">

<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT FACE="Tahoma" SIZE="2">
Hi,<BR>
<BR>
 Well currently I have a legacy database backend, that I've grafted pdns onto. That database also drives some scripts that create bind zonefiles for some other dns servers. The database also contains a field that holds the serial number for the zone, and that serial number must match across all authorative dns servers for a given zone.<BR>
<BR>
 At the moment I have pdns working fine, but it seems to be auto generating a serial number for the zones. Having looked at the opendbx backend, I see that it can handle stored serial numbers, but there's no example of an sql query which returns the serial number from the database, so I don't know what fieldname to generate, and in what position to place it. For example, one of my (horrible) sql queries looks like this:<BR>
<BR>
opendbx-sql-list=\<BR>
select domain_id,name,type,ttl,prio,content from (\<BR>
select domain_id,name,type,ttl,prio,content from (select domains.id as domain_id, concat(hosts.host, '.', domains.domain) as name, hosts.type, 14400 as ttl, 0 as prio, ho<BR>
sts.ip as content from hosts left join domains on hosts.domain = domains.domain) as hoststable where domain_id=':id' \<BR>
union all \<BR>
select domain_id,name,type,ttl,prio,content from (select domains.id as domain_id, mx.domain as name, 'MX' as type, 14400 as ttl, mx.level as prio, mx.host as content from<BR>
 mx left join domains on mx.domain = domains.domain where mx.sub='') as mxtable where domain_id=':id' \<BR>
union all \<BR>
select domain_id,name,type,ttl,prio,content from (select domains.id as domain_id, concat(mx.sub,'.',mx.domain) as name, 'MX' as type, 14400 as ttl, mx.level as prio, mx.h<BR>
ost as content from mx left join domains on mx.domain = domains.domain where mx.sub!='') as mxsubtable where name=':name' and type=':type' \<BR>
union all \<BR>
select domain_id,name,type,ttl,prio,content from (select domains.id as domain_id, domains.domain as name, 'SOA' as type, '' as ttl, 0 as prio, '' as content from domains)<BR>
 as domainsoatable where domain_id=':id' \<BR>
) as maintable \<BR>
where maintable.domain_id=':id'<BR>
<BR>
So for example, I can display the correct serial number for a given domain with the following:<BR>
<BR>
select from_unixtime(date_ammend,'%Y%m%d%h') from domains where domain = 'foo.com';<BR>
<BR>
-Cheers Max.<BR>
<TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
<TR>
<TD>
<BR>
</TD>
</TR>
</TABLE>
<BR>
</FONT> 
<HR COLOR="#cc3333">

<P><FONT COLOR="#000000"><FONT FACE="Tahoma" SIZE="2">Max Lock - Senior Systems Administrator<BR></FONT><FONT FACE="Tahoma" SIZE="2">Datanet - Hosting, Connectivity & Business Continuity</FONT></FONT><FONT COLOR="#999999" FACE="Tahoma" SIZE="2"></FONT></P><FONT SIZE="+0"></FONT>
<P>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="857b4b34-0510-4936-a728-222be3c1de38Table" STYLE="WIDTH: 25%; BORDER-COLLAPSE: collapse" WIDTH="100%">
<TBODY>
<TR>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2"><STRONG> T: </STRONG></FONT></P></TD>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2">0845 130 6010</FONT></P></TD></TR>
<TR>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2"><STRONG> F: </STRONG></FONT></P></TD>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2">0845 130 6020</FONT></P></TD></TR>
<TR>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2"><STRONG> E: </STRONG></FONT></P></TD>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2"><a href="mailto:Max.Lock@datanet.co.uk">Max.Lock@datanet.co.uk</a></FONT></P></TD></TR>
<TR>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2"><STRONG>W: </STRONG></FONT></P></TD>
<TD>
<P CLASS="857b4b34-0510-4936-a728-222be3c1de38"><A HREF="http://www.datanet.co.uk/"><FONT COLOR="#999999" FACE="Tahoma" SIZE="2">www.datanet.co.uk</FONT></A></P></TD></TR></TBODY></TABLE></P>
<P><FONT FACE="Tahoma"><FONT SIZE="1"><FONT COLOR="#999999">Registered Office: DATANET.CO.UK Limited, Aspen House, Barley Way, Ancells Business Park, Fleet, Hampshire, GU51 2UT </FONT><FONT COLOR="#999999">Registered in England - No. 3214053 <BR>Providing Internet Solutions for Business since 1996, Datanet, over 12 years of excellence in service, support and IP solutions </FONT></FONT></FONT></P>
<P></P>
<P><A HREF="http://www.datanet.co.uk/awards_and_affiliates.aspx"><STRONG><FONT COLOR="#000000" FACE="Tahoma" SIZE="1">Datanet.co.uk - Proud Winner of ISPA Awards in 2005, 2007 & 2008</FONT></STRONG></A></P>
<P><A HREF="http://www.datanet.co.uk/datacentre_diary.aspx" TARGET="_blank"><B><FONT COLOR="#000000" FACE="Tahoma" SIZE="1">Datanet Datacentre Now Open at Aspen House Fleet! Call us on 0845 130 6010 to arrange a visit!</FONT></B></A><FONT COLOR="#993300" FACE="Tahoma" SIZE="2"> </FONT></P>
<P><FONT COLOR="#993300" FACE="Tahoma" SIZE="2"> </FONT></P>
<P><FONT FACE="Tahoma" SIZE="2">-----Original Message-----<BR><BR>
<B>From</B>: Norbert Sendetzky <<A HREF="mailto:Norbert%20Sendetzky%20%3cnorbert@linuxnetworks.de%3e">norbert@linuxnetworks.de</A>><BR>
<B>To</B>: <A HREF="mailto:pdns-users@mailman.powerdns.com">pdns-users@mailman.powerdns.com</A><BR>
<B>Subject</B>: Re: [Pdns-users] OpenDBX Backend and serial numbers.<BR>
<B>Date</B>: Thu, 16 Oct 2008 19:05:31 +0200<BR>
<BR>
<PRE>
Hi Max

>  I'm using the OpenDBX backend, and by default it generates serial
> numbers as it should. However I want to use the notified_serial field in
> the database. How shoud the sql queries for opendbx-sql-list be changed?
> The default is:
>
> opendbx-sql-list=SELECT "domain_id", "name", "type", "ttl", "prio",
> "content" FROM "records" WHERE "domain_id"=:id

What do you want to use the notified_serial field for?


Norbert
_______________________________________________
Pdns-users mailing list
<A HREF="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</A>
<A HREF="http://mailman.powerdns.com/mailman/listinfo/pdns-users">http://mailman.powerdns.com/mailman/listinfo/pdns-users</A>
</PRE>
</FONT></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P></P></P></BODY></HTML>