DNS bind-dlz连接数据库问题
在cenos7上安装了bind-9.11, 编译时启用了DLZ,数据库用的mysql-5.7,但是启动的时候一直报错,直接使用zone文件启动就是好的,下面是named.conf的配置和报错信息,请各位看看到底是哪里出错了?
options{
directory"/opt/bind-9.11/var/named";
listen-on port 53 { any; };
allow-query-cache { any; };
allow-query { any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
};
logging {
channel query_log {
file "/opt/bind-9.11/var/log/named/query.log" versions 20 size 300m;
severity info;
print-time yes;
print-category yes;
};
channel error_log {
file "/opt/bind-9.11/var/log/named/error.log" versions 3 size 10m;
severity info;
print-time yes;
print-severity yes;
print-category yes;
};
category queries { query_log; };
category default { error_log; };
};
key "rndc-key" {
algorithm hmac-md5;
secret "y8pesUMzXhqdGRgO9cdlfg==";
};
controls {
inet 127.0.0.1 port 953
allow{ 127.0.0.1; } keys {"rndc-key";};
};
#zone "test.info" IN {
# type master;
# file "db.opstar.club";
# allow-update { none; };
#};
dlz "Mysql zone" {
database "mysql
{host=localhost dbname=bind ssl=false port=3306 user=test pass=123.com}
{select zone from dns_records where zone = '$zone$'}
{select ttl, type, mx_priority, case when lower(type)='txt' then concat('\"', data, '\"')
when lower(type) = 'soa' then concat_ws(' ', data, resp_person, serial, refresh, retry, expire, minimum)
else data end from dns_records where zone = '$zone$' and host = '$record$'}";
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论