// This is the /etc/named.boot (boot files) for the primary name server
// of the one.edu. domain.
//首先定义配置文件的位置:
directory "/etc/named";
//定义转发器,除了本机定义的域外其他所有请求都发向转发器(非官方授权的DNS服务器基本上都要定义转发器)
forwarders {
202.101.98.54;
202.101.98.55;
};
};
//接下来指定根DNS服务器的配置文件,此文件可从网络下载:
zone "." in {
type hint;
file "named.root";
};
//本机负责解析的域的正向解析配置文件,此例中为one.edu域,配置文件为one.zone
zone "one.edu" in {
type master;
file "one.zone";
};
//本机负责解析的域的反向解析配置文件,此例中为one.edu域,配置文件为one.zone
zone "1.168.192.in-addr.arpa" in {
type master;
file "one.rzone";
};
//环回反向解析配置文件
zone "0.0.127.in-addr.arpa" in {
type master;
file "loop.back";
};
//下面是BIND9专用的配置内容
// Use with the following in named.conf, adjusting the allow list as needed:
// See rndc-confgen command-manual
key "rndc-key" {
algorithm hmac-md5;
secret "/cCelQY6sE40JIwQDtXf6g==";
};
controls {
inet * allow { any; } keys { "rndc-key"; };
};
/*
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};*/
; /var/named/loop.back file for the primary name server.
;
; Start of Authority section
$ORIGIN 0.0.127.IN-ADDR.ARPA.
;
$TTL 8h
; The next line is very long, but is ONE line.
0.0.127.IN-ADDR.ARPA. IN SOA sys11.one.edu. root.sys11.one.edu. (
20011225 ; version number
10800 ; refresh (3hrs.)
3600 ; retry (1hr.)
432000 ; expire (5days)
86400 ) ; ttl (1day)
0.0.127.IN-ADDR.ARPA. IN NS sys11.one.edu.
1 IN PTR localhost.one.edu.
; /var/named/one.zone file for the one.edu. name server
; This file resolves hostnames to IP addresses in the one.edu. domain.
;
$ORIGIN one.edu.
; Time to live (post BIND 8.2) 8 hours
$TTL 8h
one.edu. IN SOA sys11.one.edu. root.sys11.one.edu. (
20011225 ; serial number
10800 ; refresh (3hrs)
3600 ; retry (1hr)
432000 ; expire (5days)
86400 ) ; ttl (1day)
;
; Domain Section
;下面这条意思是one.edu这个域由sys11.one.edu这台主机负责解析
one.edu. IN NS sys11.one.edu.
;
; Host Information Section
; Example; "sys12 IN A 192.168.1.2"
;下面就是主机和IP的对应关系了,sys11 IN A 192.168.1.1就表示sys11.one.edu这个域名的IP为192.168.1.1
sys11 IN A 192.168.1.1
sys12 IN A 192.168.1.2
sys13 IN A 192.168.1.3
sys17 IN A 192.168.1.17
gw IN A 192.168.1.254
xp IN A 192.168.1.11 ;下面的A记录把所有的域名都指向到IP地址192.168.1.100 * IN A 192.168.1.100
/********/etc/named/one.rzone **********/
; /var/named/one.rzone file for the one.edu. primary name server
; This file resolves IP addresses to hostnames in the one.edu. domain.
;
$ORIGIN 1.168.192.IN-ADDR.ARPA.
; Time to live (post BIND 8.2) 8 hours
$TTL 8h
1.168.192.IN-ADDR.ARPA. IN SOA sys11.one.edu. root.sys11.one.edu. (
20011225 ; serial number
10800 ; refresh (3hrs)
3600 ; retry (1hr)
432000 ; expire (5days)
86400 ) ; ttl (1day)
1.168.192.IN-ADDR.ARPA. IN NS sys11.edu.
; In this section put ONLY the host portion of IP address for each
; host in the one.edu domain. ex. "1 IN PTR sys11.one.edu."
1 IN PTR sys11.one.edu.
2 IN PTR sys12.one.edu.
3 IN PTR sys13.one.edu.
17 IN PTR sys17.one.edu.
254 IN PTR gw.one.edu.