# [SOLVED] Bind 9.7.0_p1 and DLZ?

## gixer

I just updated to Bind 9.7.0_p1 and suddenly my DLZ is no longer working! It segfaults with the following error:

26-May-2010 05:48:02.611 Loading 'Mysql zone' using driver mysql

26-May-2010 05:48:02.611 Loading SDLZ driver.

26-May-2010 05:48:02.611 Required token $zone$ not found.

26-May-2010 05:48:02.611 Could not build all nodes query list

26-May-2010 05:48:02.611 mysql driver could not create database instance object.

Segmentation fault (core dumped)

I have not changed the named.conf file, and it's been working for years! I'm wondering if anyone else has run into this, or if there's been some kind of change to 9.7.0? 

Downgrading to 9.4.3-P5, the problem goes away, and everything is good again.

Below is my 'working' dlz config in 9.4.3-P5:

dlz "Mysql zone" {

database "mysql

{host=localhost dbname=xxxxx ssl=false port=3306 user=xxxxx pass=xxxxxx}

{select zone from dns_records where zone = '%zone%' limit 1}

{select ttl, type, mx_priority, 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, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum

        from dns_records where zone = '%zone%' and (type = 'SOA' or type='NS')}

{select ttl, type, host, mx_priority, 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 data_count set count = count + 1 where zone ='%zone%'}";

};

Appreciate any help/comments....

-Allan

----------

## erik258

Not many use DLZ, from what I know, and your chances of getting relevant help from the gentooers at this point seem pretty slim.  I personally forsook DLZ long ago rather than patch it to better handle losing its mysql connection.  But the error seems to suggest that maybe you need to update your configuration to work with the new versions, since the error seems to say that something's wrong with your config.  

Anyhow, if you want a real answer I recommend the dlz mailing list.  

http://bind-dlz.sourceforge.net/mailing_list.html

----------

## gixer

Ok, so MONTHS later, I found the answer to this! Thought I would share. Those using DLZ with Bind, like myself, WILL run into this problem! If you look at the docs on the homepage for DLZ, the examples it gives are WRONG!! Only slightly, but enough to crash bind when attempting to use DLZ. Here's what's wrong:

In the examples, it uses '%zone%' and '%record%' ... really they MUST be '$zone$' and '$record$' ... any 'token' is with a $ NOT a %. I don't know at what version this changed, but no one bothered to update the docs!! Anyways I finally found it and hope it saves someone else time and effort.

----------

## jelf

 *gixer wrote:*   

> Ok, so MONTHS later, I found the answer to this! Thought I would share. Those using DLZ with Bind, like myself, WILL run into this problem! If you look at the docs on the homepage for DLZ, the examples it gives are WRONG!! Only slightly, but enough to crash bind when attempting to use DLZ. Here's what's wrong:
> 
> In the examples, it uses '%zone%' and '%record%' ... really they MUST be '$zone$' and '$record$' ... any 'token' is with a $ NOT a %. I don't know at what version this changed, but no one bothered to update the docs!! Anyways I finally found it and hope it saves someone else time and effort.

 

God bless you

----------

