Linux redhat5.5上做dns的父域和子域及对子域的授权,windows 2003上做dns的子域和转发。
65-1
# hostname
www.a.com
# cat /etc/hosts
192.168.2.10 www.a.com dns
# cat /etc/sysconfig/network
HOSTNAME=www.a.com
# rpm -qa |grep bind
# rpm -ivh bind--4.P1.el5_4.2.i386.rpm bind-chroot--4.P1.el5_4.2.i386.rpm caching-nameserver-9.3.6-4.P1.el5_4.2.i386.rpm
# cd /var/named/chroot/etc/
# cp named.caching-nameserver.conf named.conf
# chgrp named named.conf
# vim named.conf
options {
listen-on port 53 { any; };
allow-query { any; };
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
# vim named.rfc1912.zones
zone "a.com" IN {
type master;
file "a.com.zone";
allow-update { none; };
};
zone "bj.a.com" IN {
type master;
file "bj.a.com.zone";
allow-update { none; };
};
# cd /var/named/chroot/var/named/
# cp -p a.com.zone bj.a.com.zone
# vim a.com.zone
$TTL 86400
@ IN SOA ns.a.com. root (
42 ; serial (d. )
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns.a.com.
ns IN A 192.168.2.10
www IN A .1
--在父域的数据库里做授权
sh.a.com. IN NS ns.sh.a.com.
ns.sh.a.com. IN A 192.168.2.20
# vim bj.a.com.zone
$TTL 86400
@ IN SOA ns.bj.a.com. root (
42 ; serial (d. )
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns.bj.a.com.
ns IN A 192.168.2.10
www IN A .2
# service named start
# vim /etc/resolv.conf
nameserver 192.168.2.10
# nslookup www.a.com
Server: 192.168.2.10
Address: 192.168.2.10#53
Name: www.a.com
Address: .1
# nslookup www.bj.a.com
Server: 192.168.2.10
Address: 192.168.2.10#53
Name: www.bj.a.com
Address: .2
# nslookup www.sh.a.com
Server: 192.168.2.10
Address: 192.168.2.10#53
Non-authoritative answer:
Name: www.sh.a.com
Address: .3
Windows 2003上安装dns并建子域
65-2
65-3
65-4
如果客户端在sh.a.com域则会找不到a.com的域了,需要做转发
65-5
65-6
Windows平台上的dns的授权和转发
1.Windows server 2003 下做dns的父域b.com和子域bj.b.com
2.Linux下做dns的父域b.com的授权子域sh.b.com
1.windows
父域
2.子域
65-7
3.授权