详细请查看
这个是从原来的Easy-CDN管理系统中分离出来的,是专门管理内部DNS的!
bind-dlz安装
wget
tar -zxvf bind-9.6.0-P1.tar.gz
cd bind-9.6.0-P1
./configure --with-dlz-mysql --enable-largefile --enable-threads=no --prefix=/usr/local/bind
make -j4
make install
cd ..
cd /usr/local/bind/etc
dig > named.root
../sbin/rndc-confgen >rndc.conf
tail -n10 rndc.conf | head -n9 | sed -e s/#\//g >named.conf
再编译named.conf
options {
version "Bind 10.0.01";
recursion no;
allow-query { any; };
allow-transfer { none; };
directory "/usr/local/bind/etc";
pid-file "named.pid";
};
logging {
channel query_log {
file "/usr/local/bind/var/query.log" versions 10 size 10M;
severity info;
print-time yes;
print-category yes;
};
category queries {
query_log;
};
};
dlz "Mysql zone" {
database "mysql
{host=127.0.0.1 dbname=dns ssl=false port=3306 user=root pass=root }
{select zone from dns_records where zone = '%zone%' limit 1}
{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 as mydata from dns_records where zone = '%zone%' and host = '%record%'}
{}
{select ttl, type, host, mx_priority, case when lower(type)='txt' then concat('\"', data, '\"') else data end as mydata, resp_person, serial, refresh, retry, expire, minimum from dns_records where zone = '%zone%'}
{select zone from xfr_table where zone = '%zone%' and client = '%client%' limit 1}
{update data_count set count = count + 1 where zone ='%zone%'}";
};
再下载管理工具
wget
把dns.sql导入数据库就可能管理了!
阅读(2212) | 评论(0) | 转发(0) |