Re: dlz ignores connection to postgres database

data tanger <[email protected]> Thu, 22 Mar 2012 12:18:17 +0100
Newsgroups gmane.network.dns.bind9.dlz
Message-ID <[email protected]>
--===============6905720928457222381==
Content-Type: multipart/alternative;
	boundary="_63615176-aa82-4d41-8d9d-09b5afa8320d_"

--_63615176-aa82-4d41-8d9d-09b5afa8320d_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Thank you for your answer. I took the queries I put in my config file from =
this book=20
http://jpmens.net/2010/10/29/alternative-dns-servers-the-book-as-pdf/ which=
 I think is well explained.My problem is not with queries but with the conn=
ection to the database. For instance with postgresql=2C I connect with user=
 postgres and type the follwing command to list current connections:
select * from pg_stat_activity=3B
the result only displays one connection while it had to display at least tw=
o as one mut be used by named (a permanent connection according to the docu=
mentation).
The same thing happens with mysql=2C when I type:
show provcesslist=3B
I only get one connection. I believe that named does not connect to the dat=
abase=2C but it does not diplsay any error message so that I can debug the =
issue.

> Date: Wed=2C 21 Mar 2012 13:28:16 -0700
> From: [email protected]
> To: [email protected]
> Subject: Re: [Bind-dlz-testers] dlz ignores connection to postgres databa=
se
>=20
> 2012/3/21 data tanger <[email protected]>:
> > Hi everyone=2C
> >
> > I tried to use the Bind Dlz driver but I can't get it to connect to the
> > database.When I start Bind=2C I don't see any error but I think it
> > ignores the connection to
> > the database.
> > I tried both Postgresql and Mysql with no success.
>=20
> First debugging step=2C enable query logging=2C or use tcpdump and dump
> the raw packets to see the query and the response.
>=20
> > Here's what I added to the named.conf file:
> >
> > dlz "PostgresZone" {
> > database "postgres
> > {host=3Dlocalhost port=3D5432 dbname=3Ddnsdb user=3Ddnsuser}
> > {SELECT id FROM zones WHERE zone =3D lower('%zone%') LIMIT 1}
>=20
> You're returning the id from the query=2C when all of the examples (and
> my working config on mysql) return the zone field.  Change that=2C see
> if it works.
>=20
> > {SELECT ttl=2C ttype=2C mx_priority=2C ddata FROM zones z=2C rrset r WH=
ERE
> > z.id=3Dr.zid
> > AND zone =3D lower('%zone%') AND host =3D lower('%record%') AND type NO=
T
> > IN('SOA'=2C'NS')}
> > {SELECT ttl=2C ttype=2C mx_priority=2C ddata=2C resp_person=2C serial=
=2C refresh=2C
> > retry=2C expire=2C minimum FROM zones z=2C rrset r WHERE z.id =3D r.zid=
 AND zone =3D
> > lower('%zone%') AND type IN('SOA'=2C'NS')}
> > {SELECT ttl=2C ttype=2C host=2C mx_priority=2C ddata=2C resp_person=2C =
serial=2C
> > refresh=2C retry=2C expire=2C minimum FROM zones z=2C rrset r WHERE z.i=
d =3D r.zid=09
> > AND zone =3D lower('%zone%'}
> > {SELECT id FROM axfr WHERE zone =3D lower('%zone%' AND ip =3D '%client%=
'}"=3B
>=20
> And in your xfer query=2C you're again returning the id instead of the zo=
ne field.
>=20
> > }=3B
> >
> > Any help please?
>=20
> Try those and see what happens.
>=20
> ...Todd
>=20
> --=20
> Always code as if the guy who ends up maintaining your code will be a
> violent psychopath who knows where you live. -- Martin Golding
>=20
> -------------------------------------------------------------------------=
-----
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here=20
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Bind-dlz-testers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
 		 	   		  =

--_63615176-aa82-4d41-8d9d-09b5afa8320d_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 10pt=3B
font-family:Tahoma
}
--></style></head>
<body class=3D'hmmessage'><div dir=3D'ltr'>
Thank you for your answer. I took the queries I put in my config file from =
this book&nbsp=3B
<a href=3D"http://jpmens.net/2010/10/29/alternative-dns-servers-the-book-as=
-pdf/">http://jpmens.net/2010/10/29/alternative-dns-servers-the-book-as-pdf=
/</a>&nbsp=3B<div>which I think is well explained.</div><div>My problem is =
not with queries but with the connection to the database. For instance with=
 postgresql=2C I connect with user postgres and type the follwing command t=
o list current connections:</div><div><br></div><div>select * from pg_stat_=
activity=3B</div><div><br></div><div>the result only displays one connectio=
n while it had to display at least two as one mut be used by named (a perma=
nent connection according to the documentation).</div><div><br></div><div>T=
he same thing happens with mysql=2C when I type:</div><div><br></div><div>s=
how provcesslist=3B</div><div><br></div><div>I only get one connection. I b=
elieve that named does not connect to the database=2C but it does not dipls=
ay any error message so that I can debug the issue.<br><br><div><div id=3D"=
SkyDrivePlaceholder"></div>&gt=3B Date: Wed=2C 21 Mar 2012 13:28:16 -0700<b=
r>&gt=3B From: [email protected]<br>&gt=3B To: [email protected]=
eforge.net<br>&gt=3B Subject: Re: [Bind-dlz-testers] dlz ignores connection=
 to postgres database<br>&gt=3B <br>&gt=3B 2012/3/21 data tanger &lt=3Bdata=
[email protected]&gt=3B:<br>&gt=3B &gt=3B Hi everyone=2C<br>&gt=3B &gt=3B<b=
r>&gt=3B &gt=3B I tried to use the Bind Dlz driver but I can't get it to co=
nnect to the<br>&gt=3B &gt=3B database.When I start Bind=2C I don't see any=
 error but I think it<br>&gt=3B &gt=3B ignores the connection to<br>&gt=3B =
&gt=3B the database.<br>&gt=3B &gt=3B I tried both Postgresql and Mysql wit=
h no success.<br>&gt=3B <br>&gt=3B First debugging step=2C enable query log=
ging=2C or use tcpdump and dump<br>&gt=3B the raw packets to see the query =
and the response.<br>&gt=3B <br>&gt=3B &gt=3B Here's what I added to the na=
med.conf file:<br>&gt=3B &gt=3B<br>&gt=3B &gt=3B dlz "PostgresZone" {<br>&g=
t=3B &gt=3B database "postgres<br>&gt=3B &gt=3B {host=3Dlocalhost port=3D54=
32 dbname=3Ddnsdb user=3Ddnsuser}<br>&gt=3B &gt=3B {SELECT id FROM zones WH=
ERE zone =3D lower('%zone%') LIMIT 1}<br>&gt=3B <br>&gt=3B You're returning=
 the id from the query=2C when all of the examples (and<br>&gt=3B my workin=
g config on mysql) return the zone field.  Change that=2C see<br>&gt=3B if =
it works.<br>&gt=3B <br>&gt=3B &gt=3B {SELECT ttl=2C ttype=2C mx_priority=
=2C ddata FROM zones z=2C rrset r WHERE<br>&gt=3B &gt=3B z.id=3Dr.zid<br>&g=
t=3B &gt=3B AND zone =3D lower('%zone%') AND host =3D lower('%record%') AND=
 type NOT<br>&gt=3B &gt=3B IN('SOA'=2C'NS')}<br>&gt=3B &gt=3B {SELECT ttl=
=2C ttype=2C mx_priority=2C ddata=2C resp_person=2C serial=2C refresh=2C<br=
>&gt=3B &gt=3B retry=2C expire=2C minimum FROM zones z=2C rrset r WHERE z.i=
d =3D r.zid AND zone =3D<br>&gt=3B &gt=3B lower('%zone%') AND type IN('SOA'=
=2C'NS')}<br>&gt=3B &gt=3B {SELECT ttl=2C ttype=2C host=2C mx_priority=2C d=
data=2C resp_person=2C serial=2C<br>&gt=3B &gt=3B refresh=2C retry=2C expir=
e=2C minimum FROM zones z=2C rrset r WHERE z.id =3D r.zid	<br>&gt=3B &gt=3B=
 AND zone =3D lower('%zone%'}<br>&gt=3B &gt=3B {SELECT id FROM axfr WHERE z=
one =3D lower('%zone%' AND ip =3D '%client%'}"=3B<br>&gt=3B <br>&gt=3B And =
in your xfer query=2C you're again returning the id instead of the zone fie=
ld.<br>&gt=3B <br>&gt=3B &gt=3B }=3B<br>&gt=3B &gt=3B<br>&gt=3B &gt=3B Any =
help please?<br>&gt=3B <br>&gt=3B Try those and see what happens.<br>&gt=3B=
 <br>&gt=3B ...Todd<br>&gt=3B <br>&gt=3B -- <br>&gt=3B Always code as if th=
e guy who ends up maintaining your code will be a<br>&gt=3B violent psychop=
ath who knows where you live. -- Martin Golding<br>&gt=3B <br>&gt=3B ------=
------------------------------------------------------------------------<br=
>&gt=3B This SF email is sponsosred by:<br>&gt=3B Try Windows Azure free fo=
r 90 days Click Here <br>&gt=3B http://p.sf.net/sfu/sfd2d-msazure<br>&gt=3B=
 _______________________________________________<br>&gt=3B Bind-dlz-testers=
 mailing list<br>&gt=3B [email protected]<br>&gt=3B ht=
tps://lists.sourceforge.net/lists/listinfo/bind-dlz-testers<br></div></div>=
 		 	   		  </div></body>
</html>=

--_63615176-aa82-4d41-8d9d-09b5afa8320d_--


--===============6905720928457222381==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
--===============6905720928457222381==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bind-dlz-testers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers

--===============6905720928457222381==--