bind-dlz hanging

Felipe Neuwald <[email protected]>
Newsgroups gmane.network.dns.bind9.dlz
Message-ID <[email protected]>
Hi Folks.

I'm running bind9-dlz+mysql-9.3.2+0.7.0 with a mysql 5.1.22 server on a 
FreeBSD 6.3-STABLE machine.

My bind-dlz works ok for some hoursm but, after some time, the named 
process hangs and I have to manually start it again.

Here is my /usr/local/etc/named.conf:

<begin>
[root@br-spo-02 /]# cat /usr/local/etc/named.conf 
options {
        // Relative to the chroot directory, if any
        directory       "/etc/namedb";
        pid-file        "/var/run/new-named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";
};

key "rndc-key" {
      algorithm hmac-md5;
      secret "xxxxxxxxxxxxxxxx";
};

controls {
      inet 127.0.0.1 port 953
              allow { 127.0.0.1; } keys { "rndc-key"; };
};


zone "." { type hint; file "named.root"; };

dlz "Mysql zone" {
   database "mysql
   {host=127.0.0.1 dbname=dns user=dns pass=xxxxxxxxxxxxx}
   {SELECT zone FROM dns_records WHERE zone = '%zone%'}
   {SELECT ttl, type, mx_priority, IF(type = 'TXT', 
CONCAT('\"',data,'\"'), data) AS data
    FROM dns_records
    WHERE zone = '%zone%' AND host = '%record%' AND type <> 'SOA' AND 
type <> 'NS'}
   {SELECT ttl, type, data, primary_ns, resp_contact, serial, refresh, 
retry, expire, minimum
    FROM dns_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 dns_records
    WHERE zone = '%zone%' AND type <> 'SOA' AND type <> 'NS'}
   {SELECT zone FROM xfr where zone='%zone%' AND client = '%client%'}";
};
<end>

Here is the result of describe dns_records:

<begin>
mysql> describe dns_records;
+--------------+------------------+------+-----+---------+----------------+
| Field        | Type             | Null | Key | Default | Extra          |
+--------------+------------------+------+-----+---------+----------------+
| id           | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| zone         | varchar(255)     | NO   | MUL |         |                |
| ttl          | int(11)          | NO   |     | 86400   |                |
| type         | varchar(255)     | NO   | MUL |         |                |
| host         | varchar(255)     | NO   | MUL | @       |                |
| mx_priority  | int(11)          | YES  |     | NULL    |                |
| data         | text             | YES  |     | NULL    |                |
| primary_ns   | varchar(255)     | YES  |     | NULL    |                |
| resp_contact | varchar(255)     | YES  |     | NULL    |                |
| serial       | bigint(20)       | YES  |     | NULL    |                |
| refresh      | int(11)          | YES  |     | NULL    |                |
| retry        | int(11)          | YES  |     | NULL    |                |
| expire       | int(11)          | YES  |     | NULL    |                |
| minimum      | int(11)          | YES  |     | NULL    |                |
+--------------+------------------+------+-----+---------+----------------+
14 rows in set (0.01 sec)
<end>

And here is the result of select * from dns_records:

<begin>
mysql> select * From dns_records;
+-----+------------+-------+------+--------+-------------+-----------------+-------------+--------------------+------------+---------+-------+--------+---------+
| id  | zone       | ttl   | type | host   | mx_priority | 
data            | primary_ns  | resp_contact       | serial     | 
refresh | retry | expire | minimum |
+-----+------------+-------+------+--------+-------------+-----------------+-------------+--------------------+------------+---------+-------+--------+---------+
| 100 | sample.com | 86400 | SOA  | @      |        NULL | 
NULL            | ns1.ns.com. | hostmaster.ns.com. | 2007080601 |   
10800 |  7200 | 604800 |   86400 |
| 101 | sample.com | 86400 | NS   | @      |        NULL | 
ns1.ns.com.     | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 102 | sample.com | 86400 | NS   | @      |        NULL | 
ns2.ns.com.     | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 103 | sample.com | 86400 | MX   | @      |          10 | 
mail.mail.com.  | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 104 | sample.com | 86400 | A    | @      |        NULL | 
123.12.12.1     | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 105 | sample.com | 86400 | A    | www    |        NULL | 
123.12.12.1     | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 107 | sample.com | 86400 | A    | rafael |        NULL | 
10.12.13.11     | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 106 | sample.com | 86400 | A    | ftp    |        NULL | 
123.12.12.1     | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 108 | sample.com | 86400 | A    | ad     |        NULL | 
200.100.200.100 | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
| 109 | sample.com | 86400 | A    | flavio |        NULL | 
200.10.20.30    | NULL        | NULL               |       NULL |    
NULL |  NULL |   NULL |    NULL |
+-----+------------+-------+------+--------+-------------+-----------------+-------------+--------------------+------------+---------+-------+--------+---------+
10 rows in set (0.00 sec)
<end>

Does anybody knows why it's happening?

Thanks,

Felipe Neuwald.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.