架构图2:
二、编译
[root@linux root]#tar xfz bind-9.7.1-P2.tar.gz
[root@linux root]# cd bind-9.7.1-P2
[root@linux bind-9.7.1-P2]#./configure --prefix=/usr/local/named --enable-threads
#--enable-threads开启多线程处理能力
[root@linux bind-9.7.1-P2]#make
[root@linux bind-9.7.1-P2]#make install
三、配置
[root@linux bind-9.7.1-P2]#cd /usr/local/named/etc
生成rndc控制命令的key文件
[root@linux named]# /usr/local/named/sbin/rndc-confgen > /usr/local/named/etc/rndc.conf
从rndc.conf文件中提取named.conf用的key
[root@linux etc]# tail -10 rndc.conf | head -9 | sed s/#\ //g > /usr/local/named/etc/named.conf
自动在/usr/local/named/etc 生成named,conf文件
1、
vi named.conf
key "rndc-key" {
algorithm hmac-md5;
secret "7eBY6yefaA5xVWc1uUcoKA==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
options {
directory "/usr/local/named/etc";
dump-file "/usr/local/named/var/cache_dump.db";
statistics-file "/usr/local/named/var/named_stats.txt";
pid-file "/usr/local/named/var/run/named.pid";
};
# forward only; //只允許 forward!
#forwarders {
# 168.95.1.1; //我这里使用 hinet 的 DNS !
# 139.175.10.20; //这个是 seednet 的 DNS !
# };
zone "." IN {
type hint;
file "named.root";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "qqvm.com" IN {
type master;
file "qqvm.zone";
allow-update { none; };
};
2、生成named.root
[root@linux etc]#dig >named.root
3、
建立localhost.zone文件
[root@linux named]#vi localhost.zone
$TTL 600
@ IN SOA localhost. root.localhost. (
2010102001
; Serial 28800
; Refresh slave
14400
; Retry 当 slave 主机更新失败,多久再重新更新一次
720000
; Expire 重复 retry 多久后就宣告不治....不再更新
86400 ) ; Minimum 可視為 TTL ,尤其是你沒有设定 $TTL 时@ IN NS localhost.
localhost. IN A 127.0.0.1
4、建立一个qqvm.zone
$TTL 600
@ IN SOA qqvm.com. root.qqvm.com. (
2010102001 ; Serial
28800 ; Refresh slave
14400 ; Retry 当 slave 主机更新失败,多久再重新更新一次
720000 ; Expire 重复 retry 多久后就宣告不治....不再更新
86400 ) ; Minimum 可視為 TTL ,尤其是你沒有设定 $TTL 时
@ IN NS qqvm.com.
IN A 192.168.200.143
IN MX 5 qqvm.com.
www IN A 192.168.200.141
5、启动
/usr/local/named/sbin/named -c /usr/local/named/etc/named.conf
/usr/local/named/sbin/rndc reload