[Pdns-users] gmysql-basic-query

Richard Mayhew - Nashua Broadband RichardM at nashuabroadband.com
Thu Jun 29 14:19:59 UTC 2006


Hi

This is what I added to my config file to do what you were after. I
might have gone over board but they seem to work for me.

#MySQL Custom Queries
gmysql-master-zone-query=select master from domains where name='%s' and
type='SLAVE' and status='A'
gmysql-info-all-master-query=select
id,name,master,last_check,notified_serial,type from domains where
type='MASTER' and status='A'
gmysql-info-zone-query=select
id,name,master,last_check,notified_serial,type from domains where
name='%s' and status='A'
gmysql-basic-query=select content,ttl,prio,type,domain_id,name from
records where type='%s' and name='%s' and status='A'
gmysql-id-query=select content,ttl,prio,type,domain_id,name from records
where type='%s' and name='%s' and domain_id=%d and status='A'
gmysql-any-query=select content,ttl,prio,type,domain_id,name from
records where name='%s' and status='A'
gmysql-any-id-query=select content,ttl,prio,type,domain_id,name from
records where name='%s' and domain_id=%d and status='A'
gmysql-list-query=select content,ttl,prio,type,domain_id,name from
records where domain_id=%d and status='A'

The STATUS field in the database is a single CHAR which I use 'A' for
Active, 'S' for Suspended and 'D' for Deleted. We will set the domain as
deleted for 24hrs and then remove it just incase there is a problem and
we need to re-instate it.

Hope this helps...

 

-----Original Message-----
From: pdns-users-bounces at mailman.powerdns.com
[mailto:pdns-users-bounces at mailman.powerdns.com] On Behalf Of Dan Nica
Sent: 29 June 2006 12:16 PM
To: pdns-users at mailman.powerdns.com
Subject: [Pdns-users] gmysql-basic-query

hi

I want to disable a domain from sql, so I added a "status" row to the
domain tables and modified the gmysql-basic-query in pdns.conf like
this:
gmysql-basic-query=select
r.content,r.ttl,r.prio,r.type,r.domain_id,r.name from records r left
join domains d on (r.domain_id = d.id) where d.status='0' and
r.type='%s' and r.name='%s'
but it looks like it wont work :(

what am I doing wrong ?

10x
--
Dan
_______________________________________________
Pdns-users mailing list
Pdns-users at mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users


More information about the Pdns-users mailing list