- 注册时间
- 2010-3-9
- 最后登录
- 2017-2-15
- 在线时间
- 116 小时
- 阅读权限
- 90
- 积分
- 12696
- 帖子
- 55
- 主题
- 13
- 精华
- 2
- UID
- 8214
 
- 签到
- 134
- 注册时间
- 2010-3-9
- 最后登录
- 2017-2-15
- 在线时间
- 116 小时
- 阅读权限
- 90
- 积分
- 12696
- 帖子
- 55
- 主题
- 13
- 精华
- 2
- UID
- 8214
|
发表于 2010-11-19 16:45:09
|显示全部楼层
本帖最后由 firstsko 于 2010-11-19 21:01 编辑
用了Bind-DLZ 有View功能,目前公司里自己在用,因为单位暂时没那么多资源,只设置了电线和网通线路,默认都是电线,需要其他资源的需要修改小数据库。添加了一些小功能,可以查看当前bind的运行状态,以及域名信息,如果down了会有显示,以后有时间应该会陆续添加一些小功能,方便管理DNS,因为很喜欢做界面,也会多多美化下。我已经修改成通用版本了,可以正常使用。bind-dlz 安装请查看相关文档,我稍后会把这里的配置传上来。下一個版本將添加清理緩存的功能和控制bind服務啟動的功能。
mycdn.rar
(218.03 KB, 下载次数: 2081)
namede.conf文件的代碼(開了遞歸,因為現在機器在內網):
- key "rndc-key" {
- algorithm hmac-md5;
- secret "gOszdwp5stjsnfI7MybyIg==";
- };
- controls {
- inet 127.0.0.1 port 953
- allow { 127.0.0.1; } keys { "rndc-key"; };
- };
- options{
- directory "/usr/local/bind/etc";
- forwarders {202.96.209.133;};
- pid-file "/usr/local/bind/etc/named.pid";
- statistics-file "/usr/local/bind/etc/named.stats";
- recursion yes;
- allow-query {any;};
- allow-transfer {any;};
- };
- logging {
- channel bind_info {
- file "/var/log/bind.log" versions 20 size 20m;
- print-category yes;
- print-time yes;
- severity notice;
- };
- category default {
- bind_info;
- };
- };
- include "/usr/local/bind/etc/view.conf";
- include "/usr/local/bind/etc/cnc.acl";
复制代码
view.conf部份的代碼:
- #cnc-view
- VIEw "cnc_view" {
- match-clients { CNC; };
- allow-query-cache { ANY; };
- allow-recursion { ANY; };
- allow-transfer { ANY; };
- recursion yes;
- dlz "Mysql zone" {
- database "mysql
- {host=127.0.0.1 dbname=dns ssl=false port=3306 user=root pass=Mm123456}
- {select zone from dns_records where zone = '$zone$' and view='CNC' 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 view='CNC' 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 view='CNC' and not (type = 'SOA' or type = 'NS')}
- {select zone from xfr_table where zone = '$zone$' and view='CNC' and client = '$client$'}
- {update data_count set count = count + 1 where zone ='$zone$'}";
- };
- zone "." IN {
- type hint;
- file "named.root";
- };
- };
- #cnc-view
- view "any_view" {
- match-clients { ANY; };
- allow-query-cache { ANY; };
- allow-recursion { ANY; };
- allow-transfer { ANT; };
- dlz "Mysql zone" {
- database "mysql
- {host=127.0.0.1 dbname=dns ssl=false port=3306 user=root pass=Mm123456}
- {select zone from dns_records where zone = '$zone$' and view='TELCOM' 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 view='TELCOM' 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 view='TELCOM' and not (type = 'SOA' or type = 'NS')
- }
- {select zone from xfr_table where zone = '$zone$' and view='TELCOM' and client = '$client$'}
- {update data_count set count = count + 1 where zone ='$zone$'}";
- };
- zone "." IN {
- type hint;
- file "named.root";
- };
- };
复制代码
安装方法:
修改 config/config.php 里面的mysql连接参数
默认用户名: admin1 密码admin1
补充内容 (2012-3-3 00:55):
65楼有selboo修改的部分,可以按照当前时间戳来设置TTL,修复了分页的bug。感谢。 |
-
总评分: 积分 + 22
查看全部评分
|