2012-09-16 48 views
0

我从源代码编译绑定9(见下文),并建立与MySQL DLZ的Bind9。 当我试图从服务器获取关于缓冲区溢出的任何信息时,我总是收到错误。我GOOGLE了很多次,但找不到任何关于如何解决这个错误。Bind9和MySQL的DLZ缓冲区错误

配置选项:

[email protected]:/opt/bind9/bind-9.9.1-P3# named -V BIND 9.9.1-P3 built with '--prefix=/opt/bind9' '--mandir=/opt/bind9/man' '--infodir=/opt/bind9/info' '--sysconfdir=/opt/bind9/config' '--localstatedir=/opt/bind9/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-dlz-postgres=no' '--with-dlz-mysql=yes' '--with-dlz-bdb=no' '--with-dlz-filesystem=yes' '--with-dlz-stub=yes' '--with-dlz-ldap=yes' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' using OpenSSL version: OpenSSL 1.0.1 14 Mar 2012 using libxml2 version: 2.7.8

这是我收到的时候我dig example.com(含调试)错误:

Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') else data end from dns_records where zone = 'example.com' and host = '@'

17-Sep-2012 01:09:33.610 dns_rdata_fromtext: buffer-0x7f5bfca73360:1: unexpected end of input 17-Sep-2012 01:09:33.610 dns_sdlz_putrr returned error. Error code was: unexpected end of input 17-Sep-2012 01:09:33.610 Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') else data end from dns_records where zone = 'example.com' and host = '*'

17-Sep-2012 01:09:33.610 query.c:2579: fatal error: 17-Sep-2012 01:09:33.610 RUNTIME_CHECK(result == 0) failed 17-Sep-2012 01:09:33.610 exiting (due to fatal error in library)

的named.conf

options { 
    directory "/opt/bind9/"; 
    allow-query-cache { none; }; 
    allow-query { any; }; 
    recursion no; 
}; 

dlz "Mysql zone" { 
    database "mysql 
    {host=localhost dbname=system ssl=false user=root pass=*password*} 
    {select zone from dns_records where zone = '$zone$'} 
    {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$'} 
    {} 
    {} 
    {} 
    {}"; 
}; 

回答

0

手动登录到D B并运行查询。看看它出现了什么。错误表示它有意想不到的输入结束,这意味着它期望得到一些东西,它从来没有得到它。所以首先要看你是否可以手动获取它。也许mysqld没有运行。也许用户没有定义或者密码设置错误或者没有在该表上授予权限。这些都可能导致错误。

假设这一切工作,那么你有两种选择:

  • named.conf让你有更多的数据与刚刚发生
  • 删除工作,重新安装BIND启用更多的日志记录,以确保所有哈希上的所有库和匹配所有依赖关系都已到位。

0

你是否运行命名单线程(带“-n 1”参数)?如果不是这样,由于MySQL DLZ模块不是线程安全的,所以在并行处理多个查询时,named会在各个地方崩溃。

0

我已经与DLZ在CentOS 7上工作绑定。我没有得到影响你的错误。

我意识到这是一个较旧的帖子,但我想我会分享我的conf文件,并配置选项。

我使用绑定9.11.0

配置

./configure --prefix=/usr --sysconfdir=/etc/bind --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-threads --enable-largefile --with-libtool --enable-shared --enable-static --with-openssl=/usr --with-gssapi=/usr --with-gnu-ld --with-dlz-postgres=no --with-dlz-mysql=yes --with-dlz-bdb=no --with-dlz-filesystem=yes --with-dlz-stub=yes --enable-ipv6 

的named.conf

// This is the primary configuration file for the BIND DNS server named. 
// 
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the 
// structure of BIND configuration files in Debian, *BEFORE* you customize 
// this configuration file. 
// 
// If you are just adding zones, please do that in /etc/bind/named.conf.local 
#auskommentiert !!! 
#include "/etc/bind/named.conf.options"; 
#include "/etc/bind/named.conf.local"; 
#include "/etc/bind/named.conf.default-zones"; 


key "rndc-key" { 
      // how was key encoded 
      algorithm hmac-md5; 
      // what is the pass-phrase for the key 
       secret "noway"; 
      }; 


#options { 
#default-key "rndc-key"; 
#default-server 127.0.0.1; 
#default-port 953; 
#}; 

controls { 
inet * port 953 allow { any; } keys { "rndc-key"; }; 
#inet * port 53 allow { any; } keys { "rndc-key"; }; 
}; 



logging { 
    channel query.log { 
     file "/var/log/query.log"; 
     // Set the severity to dynamic to see all the debug messages. 
     severity dynamic; 
    }; 

    category queries { query.log; }; 
}; 


dlz "Mysql zone" { 
    database "mysql 
    {host=172.16.254.100 port=3306 dbname=dyn_server_db user=db_user pass=db_password} 
    {SELECT zone FROM dyn_dns_records WHERE zone = '$zone$'} 
    {SELECT ttl, type, mx_priority, IF(type = 'TXT', CONCAT('\"',data,'\"'), data) AS data 
    FROM dyn_dns_records 
    WHERE zone = '$zone$' AND host = '$record$' AND type <> 'SOA' AND type <> 'NS'} 
    {SELECT ttl, type, data, primary_ns, resp_person, serial, refresh, retry, expire, minimum 
    FROM dyn_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_person, serial, refresh, retry, expire, minimum 
    FROM dyn_dns_records 
    WHERE zone = '$zone$' AND type <> 'SOA' AND type <> 'NS'} 
    {SELECT zone FROM xfr_table where zone='$zone$' AND client = '$client$'}"; 
};