Bind dlz 测试手记
来源:互联网 发布:ubuntu 搜狗拼音 乱码 编辑:程序博客网 时间:2024/05/01 04:18
一.Bind-DLZ介绍
Bind-DLZ主页:http://bind-dlz.sourceforge.net/
Bind-DLZ发布软件的频率跟不上Bind9,新版本的Bind9不被官方的Bind-DLZ支持,因此有人做了跟进。
DLZ(Dynamically Loadable Zones)与传统的BIND9不同,BIND的不足之处:
二.安装配置Bind-DLZ
#mkidr /usr/local/src/bind
#cd /usr/local/src/bind
#wget http://ftp.isc.org/isc/bind9/9.6.0-P1/bind-9.6.0-P1.tar.gz
#tar zxvf bind-9.6.0-P1.tar.gz
#cd bind-9.6.0-P1
1.编译安装注:采用mysql做后台数据库,千万不能用?enable-threads选项启用多线程,网上有一些朋友使用mysql做后台,谈到bind会莫名中断服务,大部分都是因为打开了多线程。
2.创建相关配置文件vi localhost.zone
ttl 86400dig > named.root
3.在named.conf中添加DLZ相关的设置
#vi named.conf //在后面添加如下
dlz "Mysql zone" {
database "mysql
{host=127.0.0.1 dbname=dns ssl=false port=3306 user=root pass= } //数据库相关连接账号,注意填写正确.
{select zone from dns_records where zone = '%zone%' limit 1}
{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%'
and not (type = 'SOA' or type = 'NS')}
{select ttl, type, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum
from dns_records where zone = '%zone%' and (type = 'SOA' or type='NS')}
{select ttl, type, host, mx_priority, data, resp_person, serial, refresh, retry, expire,
minimum from dns_records where zone = '%zone%' and not (type = 'SOA' or type = 'NS')}
{select zone from xfr_table where zone = '%zone%' and client = '%client%'}
{update data_count set count = count + 1 where zone ='%zone%'}";
};
4. 创建DNS数据库建一个表dns_records5.在在终端启动调试bind服务
[root@lemp ~]# /usr/local/bind/sbin/named -uroot -g -d 1
/usr/local/bind/sbin/named: error while loading shared libraries: libmysqlclient.so.16 //出错
#ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.16 /usr/lib/ //建立链链接即可.
#ldconfig
# /usr/local/bind/sbin/named -uroot -g -d 1 //无报错信息,继续如下.
三.添加相关记录并进行测试.
1.#zone anlegen:
--soa--linuxtone.org redirection for any host to linuxtone.org.--nameserver for zone--toplevel-ip-address of zone itself2.#host anlegen:
--ip nameserver (resp_person can be NULL)A:www.linuxtone.orgA:bbs.linuxtone.org3.#host alias anlegen:
--ns2 directs to ns1alias:man.linuxtone.org cname wwwalias: host.linuxton.org cname bbs4.#mailserver anlegen:
--ns2 directs to ns1四.相关表结构及bind查询测试.
1.表结构:
2.查询测试(增加记录实时生效,再也不要像以前一样重启相关配置文件了.)
附:
我的表结构和相关数据:{请下载}
named.conf配置文件:
四.启动脚本(增加named进程数,提高性能!)
1.创建多个named.conf配置文件
2.启动脚本
[root@lemp etc]# vi /etc/init.d/named
#!/bin/bash
# named a network name service.
# chkconfig: 345 35 75
# description: a name server
# http://www.linuxtone.org
if [ `id -u` -ne 0 ]
then
echo "ERROR:For bind to port 53,must run as root."
exit 1
fi
case "$1" in
start)
if [ -x /usr/local/bind/sbin/named ]; then
for i in `seq 1 8`
do
/usr/local/bind/sbin/named -c /usr/local/bind/etc/named1$i.conf -u root
echo "BIND9-named1$i server started"
done
fi
;;
stop)
kill `cat /usr/local/bind/var/named.pid` && echo . && echo 'BIND9 server stopped'
;;
restart)
echo .
echo "Restart BIND9 server"
$0 stop
sleep 10
$0 start
;;
reload)
/usr/local/bind/sbin/rndc reload
;;
status)
/usr/local/bind/sbin/rndc status
;;
*)
echo "$0 start | stop | restart |reload |status"
;;
Bind-DLZ主页:http://bind-dlz.sourceforge.net/
Bind-DLZ发布软件的频率跟不上Bind9,新版本的Bind9不被官方的Bind-DLZ支持,因此有人做了跟进。
DLZ(Dynamically Loadable Zones)与传统的BIND9不同,BIND的不足之处:
- BIND从文本文件中获取数据,这样容易因为编辑错误出现问题。
- BIND需要将数据加载到内存中,如果域或者记录较多,会消耗大量的内存。
- BIND启动时解析Zone文件,对于一个记录较多的DNS来说,会耽误更多的时间。
- 如果近修改一条记录,那么要重新加载或者重启BIND才能生效,那么需要时间,可能会影响客户端查询。
二.安装配置Bind-DLZ
#mkidr /usr/local/src/bind
#cd /usr/local/src/bind
#wget http://ftp.isc.org/isc/bind9/9.6.0-P1/bind-9.6.0-P1.tar.gz
#tar zxvf bind-9.6.0-P1.tar.gz
#cd bind-9.6.0-P1
1.编译安装注:采用mysql做后台数据库,千万不能用?enable-threads选项启用多线程,网上有一些朋友使用mysql做后台,谈到bind会莫名中断服务,大部分都是因为打开了多线程。
2.创建相关配置文件vi localhost.zone
ttl 86400dig > named.root
3.在named.conf中添加DLZ相关的设置
#vi named.conf //在后面添加如下
dlz "Mysql zone" {
database "mysql
{host=127.0.0.1 dbname=dns ssl=false port=3306 user=root pass= } //数据库相关连接账号,注意填写正确.
{select zone from dns_records where zone = '%zone%' limit 1}
{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%'
and not (type = 'SOA' or type = 'NS')}
{select ttl, type, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum
from dns_records where zone = '%zone%' and (type = 'SOA' or type='NS')}
{select ttl, type, host, mx_priority, data, resp_person, serial, refresh, retry, expire,
minimum from dns_records where zone = '%zone%' and not (type = 'SOA' or type = 'NS')}
{select zone from xfr_table where zone = '%zone%' and client = '%client%'}
{update data_count set count = count + 1 where zone ='%zone%'}";
};
4. 创建DNS数据库建一个表dns_records5.在在终端启动调试bind服务
[root@lemp ~]# /usr/local/bind/sbin/named -uroot -g -d 1
/usr/local/bind/sbin/named: error while loading shared libraries: libmysqlclient.so.16 //出错
#ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.16 /usr/lib/ //建立链链接即可.
#ldconfig
# /usr/local/bind/sbin/named -uroot -g -d 1 //无报错信息,继续如下.
三.添加相关记录并进行测试.
1.#zone anlegen:
--soa--linuxtone.org redirection for any host to linuxtone.org.--nameserver for zone--toplevel-ip-address of zone itself2.#host anlegen:
--ip nameserver (resp_person can be NULL)A:www.linuxtone.orgA:bbs.linuxtone.org3.#host alias anlegen:
--ns2 directs to ns1alias:man.linuxtone.org cname wwwalias: host.linuxton.org cname bbs4.#mailserver anlegen:
--ns2 directs to ns1四.相关表结构及bind查询测试.
1.表结构:
2.查询测试(增加记录实时生效,再也不要像以前一样重启相关配置文件了.)
附:
我的表结构和相关数据:{请下载}
named.conf配置文件:
四.启动脚本(增加named进程数,提高性能!)
1.创建多个named.conf配置文件
2.启动脚本
[root@lemp etc]# vi /etc/init.d/named
#!/bin/bash
# named a network name service.
# chkconfig: 345 35 75
# description: a name server
# http://www.linuxtone.org
if [ `id -u` -ne 0 ]
then
echo "ERROR:For bind to port 53,must run as root."
exit 1
fi
case "$1" in
start)
if [ -x /usr/local/bind/sbin/named ]; then
for i in `seq 1 8`
do
/usr/local/bind/sbin/named -c /usr/local/bind/etc/named1$i.conf -u root
echo "BIND9-named1$i server started"
done
fi
;;
stop)
kill `cat /usr/local/bind/var/named.pid` && echo . && echo 'BIND9 server stopped'
;;
restart)
echo .
echo "Restart BIND9 server"
$0 stop
sleep 10
$0 start
;;
reload)
/usr/local/bind/sbin/rndc reload
;;
status)
/usr/local/bind/sbin/rndc status
;;
*)
echo "$0 start | stop | restart |reload |status"
;;
esac
http://bbs.linuxtone.org/thread-2008-1-1.html
0 0
- Bind dlz 测试手记
- BIND+DLZ+MYSQL
- BIND DLZ PostgreSQL
- bind dlz view CDN配置
- 利用Bind DLZ MySQL 构建智能DNS
- debian下bind+mysql+DLZ的实现
- bind-dlz结合mysql实现智能DNS
- 一次BIND DLZ服务器的调优
- DNS BIND DLZ实现智能DNS
- bind dlz - 分布式系统的请求分发工具
- bind+dlz+mysql实现区域记录动态更新
- 智能DNS(Bind DLZ MYSQL )实际部署案例
- 智能DNS(Bind DLZ MYSQL )实际部署案例
- 测试手记
- APLIB测试手记
- pgRouting 测试手记
- 软件测试手记--连载
- 软件测试学习手记
- 关于两个activity之间切换时传递数值的情况(基于上一篇切换情况下)
- Ubuntu 11 编译 linux-2.6内核 出错,给出部分编译问题解决方暗,新问题求解决
- 提高Interface Builder高效工作的8个技巧
- tomcat使用memcached完成集群(session共享实现方式)
- Kruskal&&prim
- Bind dlz 测试手记
- 大唐天启元年
- 技术负责人的三种角色
- how to check which process occupied the port
- Sanliency detection ---my reading
- MYSQL 语句优化
- Android 高仿百度地图的LBS服务——基础地图篇(v 3.1.1)
- android 事件分发机制
- HINSTANCE HANDLE HWND 的区别及一般方法