2012-09-16 75 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$'}"; 
};