dns如何连接mysql_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$'}";

};

66cb59713eefe3d0631c3c7398e6704e.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值