要求:
1、masterdns是anlei.com域的DNS服务器,并且该服务器运行WWW服务。
2、slavedns是anlei.com的从服务器
3、Subdns是qq.anlei.com域的DNS服务器,并且该服务器运行WWW服务。
准备工作:
1、在masterdns,slavedns,subdns上安装bind,bind-unit,bind-chroot,system-config-bind
2、下载named.root文件
3、重命名 vi/etc/sysconfig/network
4、关闭防火墙 service iptables stop
5、关闭SELinux vi/etc/selinux/config SELINUX=disabled; vi/boot/grub/menu.lst selinux=0
6、重新启动
一、Masterdns配置文件
1、named.conf,该文件在/etc/named.conf和/var/named/chroot/etc/named.conf下
// Red Hat BIND Configuration Tool
//
// Default initial "Caching Only" name server configuration
//
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
zone "." {
type hint;
file "named.root";
};
zone "anlei.com" {
type master;
file "named.anlei.com";
allow-transfer {10.1.1.2;};
};
zone "1.1.10.in-addr.arpa" {
type master;
file "named.1.1.10";
allow-transfer {10.1.1.2;};
};
include "/etc/rndc.key";
2、named.root 在/var/named/chroot/var/named/下
; This file holds the information on root name servers needed to
; initialize cache of Internet domain name servers
; (e.g. reference this file in the "cache . <file>"
; configuration file of BIND domain name servers).
;
; This file is made available by InterNIC
; under anonymous FTP as
; file /domain/named.root
; on server FTP.INTERNIC.NET
;
; last update: Nov 5, 2002
; related version of root zone: 2002110501
;
;
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
; formerly TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
;
; formerly NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
;
; formerly NS.ISC.ORG
;
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
;
; formerly NIC.NORDU.NET
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
;
; operated by VeriSign, Inc.
;
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
;
; housed in LINX, operated by RIPE NCC
;
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
;
; operated by IANA
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
;
; housed in Japan, operated by WIDE
;
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
3、named.anlei.com 在/var/named/chroot/var/named/下
$TTL 86400
@ IN SOA masterdns.anlei.com. root.masterdns (2007 28800 14400 720000 86400)
@ IN NS masterdns.anlei.com.
masterdns IN A 10.1.1.1
@ IN NS slavedns.anlei.com.
slave IN A 10.1.1.2
qq IN NS subdns.qq.anlei.com.
subdns.qq.anlei.com. IN A 10.1.1.3
www IN CNAME masterdns
FTP IN CNAME masterdns
4、named.1.1.10,在/var/named/chroot/var/named/下
$TTL 86400
@ IN SOA masterdns.anlei.com. root.masterdns (2002 28800 14400 720000 86400)
@ IN NS masterdns.anlei.com.
1 IN PTR masterdns
www IN CNAME masterdns
二、slavedns的配置文件
1、named.conf文件,该文件在/etc/named.conf和/var/named/chroot/etc/named.conf下
// Red Hat BIND Configuration Tool
//
// Default initial "Caching Only" name server configuration
//
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
zone "." {
type hint;
file "named.root";
};
zone "anlei.com" {
type slave;
file "named.anlei.com";
masters {10.1.1.1;};
};
zone "1.1.10.in-addr-arpa"
{
type slave;
file "named.1.1.10";
masters {10.1.1.1;};
};
2、named.root文件
三、subdns的配置文件
1、named.conf,该文件在/etc/named.conf和/var/named/chroot/etc/named.conf下
// Red Hat BIND Configuration Tool
//
// Default initial "Caching Only" name server configuration
//
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
zone "." {
type hint;
file "named.root";
};
zone "qq.anlei.com" {
type master;
file "named.qq.anlei.com";
};
2、named.qq.anlei.com,在/var/named/chroot/var/named/下
$TTL 864000
@ IN SOA subdns.qq.anlei.com. root.subdns(2006102001 28800 14400 720000 86400)
@ IN NS subdns.qq.anlei.com.
subdns IN A 10.1.1.3
www IN CNAME subdns
3、named.root文件