1.安裝所須要的軟件包linux
#yum install bind.i686 -y(i686爲32位軟件包)安全
#yum install bind-chroot.i686 -y服務器
2.關閉防火牆(清楚規則)ide
#iptables -Fspa
3.關閉SElinux(linux的安全內核)debug
#setenforce 0dns
4.配置主域名服務器ip
需求:www.qq.com 10.0.0.1get
mail.qq.com 10.0.0.2
域名
192.168.1.1 www.qq.com
192.168.1.2 mail.qq.com
5.更新主配置文件
options {
//listen-on port 53 { 127.0.0.1; };
listen-on port 53 { any; };
//listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
//allow-query { localhost; };
allow-query { any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone "qq.com" IN {
type master;
file "qq.com.zone";
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "192.168.1.rev";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
6.更新輔助配置文件192.168.1.rev(反向查詢)
$TTL 1D
@IN SOA@ rname.invalid. (
0; serial
1D; refresh
1H; retry
1W; expire
3H ); minimum
NS dns.qq.com.
A 127.0.0.1
AAAA ::1
1 IN PTR www.qq.com.
2 IN PTR ww.baidu.com.
7.更新輔助配置文件qq.com.zone(正向查詢)
$TTL 1D
@IN SOA@ rname.invalid. (
0; serial
1D; refresh
1H; retry
1W; expire
3H ); minimum
NSdns
A127.0.0.1
AAAA::1
dns.qq.com. IN A 192.168.1.200
dns IN A 192.168.1.200
www IN A 10.0.0.1
mail IN A 10.0.0.2
v IN A 10.0.0.3
IN A 10.0.0.4
IN A 10.0.0.5