# Bind & SDB (Mysql) [solved]

## Ya.lv

got a problem: Need Bind and Mysql ...

when adding mysql flag to BIND, it shows:

```

Mar 18 12:55:53 weblapa named[26190]: unsupported database type 'mysqldb'

```

in log ... 

then was reading how to .. used: http://mysql-bind.sourceforge.net/docs.php

was doing all that is said there ... before build is started, changed/added everything that is said there ... building bind it says:

```

main.c:(.text+0xb9d): undefined reference to `mysqldb_init'

main.c:(.text+0xc3f): undefined reference to `mysqldb_clear'

collect2: ld returned 1 exit status

```

can anyone help with this one ?Last edited by Ya.lv on Wed Mar 18, 2009 7:02 pm; edited 1 time in total

----------

## nativemad

Hi, 

i use the dlz-patch to mix mysql and filebased-zones together... 

just enable the mysql and dlz use-flags and configure it in named.conf...

HTH

Cheers

----------

## Ya.lv

enabled dlz flag, but no changes ... it's still

```
Mar 18 18:02:53 weblapa named[20919]: unsupported database type 'mysqldb'

Mar 18 18:02:53 weblapa named[20919]: zone arno.id.lv/IN: loading zone: creating database: not found

```

in /var/log/messages ....

----------

## nativemad

dlz is another implementation for mysql-usage... therefore it needs another config!  :Wink: 

look here: http://bind-dlz.sourceforge.net/mysql_driver.html

my named.conf has round-about (user/pass is changed) the following... 

```

dlz "Mysql zone" {

   database "mysql

   {host=127.0.0.1 dbname=dns user=dns pass=password}

   {SELECT zone FROM records WHERE zone = '%zone%'}

   {SELECT ttl, type, mx_priority, IF(type = 'TXT', CONCAT('\"',data,'\"'), data) AS data FROM records WHERE zone = '%zone%' AND host = '%record%' AND type <> '$

   {SELECT ttl, type, data, primary_ns, resp_contact, serial, refresh, retry, expire, minimum FROM records WHERE zone = '%zone%' AND (type = 'SOA' OR type='NS')}

   {SELECT ttl, type, host, mx_priority, IF(type = 'TXT', CONCAT('\"',data,'\"'), data) AS data, resp_contact, serial, refresh, retry, expire, minimum FROM reco$

   {SELECT zone FROM xfr where zone='%zone%' AND client = '%client%'}";

};

```

Then you need of course the rigth db-scheme in mysql (i think an sql-file is in the docs at /usr/share).

----------

## Ya.lv

is there some Web interface for managing it ? got lots of them, but none of them(wich i found) gives me named.conf example

----------

## nativemad

not that i am aware of... sorry! But it shouldn't be that hard to hack one together for the dns-entries with php...   :Rolling Eyes: 

i know that webmin can configure bind, but for its common usage without db-backend!  :Wink: 

But if your problem is only the named.conf, then i can tell you that my posted config-part is the very only special part in the config at all! The whole rest is like a normal bind with all its things... <just search for a sample named.conf for your scenario and add the dlz-declaration (don't forget your mysql-access properties!)>

----------

