实验环境: Red Hat Enterprise Linux Server 5.4
DNS服务器IP:192.168.0.10
子域DNS服务器IP:192.168.0.20
客户端IP:192.168.0.30
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
allow-query { any; };
allow-query-cache { any; };
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
zone "crazylinux.com" IN {
allow-update { none; };
zone "0.168.192.in-addr.arpa" IN {
allow-update { none; };
@ IN SOA localhost. root.localhost. (
dns IN A 192.168.0.10
mail IN MX 5 mail.crazylinux.com.
www IN A 192.168.0.100
mail IN A 192.168.0.110
* IN A 192.168.0.100 //泛域名解析
@ IN A 192.168.0.100 //可以无主机头
A 地址记录
@ IN SOA localhost. root.localhost. (
IN NS dns.crazylinux.com.
10 IN PTR dns.crazylinux.com.
#chkconfig named on
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
allow-query { any; };
allow-query-cache { any; };
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
zone "bj.crazylinux.com" IN {
allow-update { none; };
zone "0.168.192.in-addr.arpa" IN {
allow-update { none; };
@ IN SOA localhost. root.localhost. (
dns IN A 192.168.0.20
mail IN MX 5 mail.crazylinux.com.
www IN A 192.168.0.210
mail IN A 192.168.0.220
A 地址记录
@ IN SOA localhost. root.localhost. (
15M ; retry
IN NS dns.crazylinux.com.
10 IN PTR 192.168.0.20
#chkconfig named on
4、 在主DNS服务器正向解析文件中设置子域委派
* IN A 192.168.0.100 //泛域名解析
@ IN A 192.168.0.100 //可以无主机头
bj IN A 192.168.0.20
IN NS dns.bj.crazylinux.com.
dns.bj.crazylinux.com. IN A 192.168.0.20 //子域委派