dlz "Mysql zone" {
database "mysql
{host=192.1.0.1 dbname=ddns ssl=true port=3306 user=ddns pass=ddns}
{select zone from dns_records where zone = '$zone$'}
{select ttl, type, case when lower(type)='txt' then concat('\"', data, '\"')
else data end from dns_records where zone = '$zone$' and host = '$record$'
and not (type = 'SOA' or type = 'NS')}
{select ttl, type, data ,case when type = 'SOA' then resp_person end,case when type = 'SOA' then serial end,case when type = 'SOA' then refresh end,case when type = 'SOA' then retry end, case when type = 'SOA' then expire end,case when type = 'SOA' then minimum end
from dns_records where zone = '$zone$' and (type = 'SOA' or type = 'NS')}
{select ttl, type, host, data, resp_person, serial, refresh, retry, expire,
minimum from dns_records where zone = '$zone$' and not (type = 'SOA' or type = 'NS')}
{select zone from xfr_table where zone = '$zone$' and client = '$client$'}
{update dns_records set data_count = data_count + 1 where zone ='$zone$'}";