Linux下BIND9.6配置

#wget http://ftp.isc.org/isc/bind9/9.6.1-P1/bind-9.6.1-P1.tar.gz

#tar zxvf bind-9.6.1-P1.tar.gz
#cd bind-9.6.1-P1

#./configure --prefix=/usr/local/named --enable-threads --disable-openssl-version-check --disable-ipv6
#make && make install

#cd /usr/local/named
#sbin/rndc-confgen > etc/rndc.conf 
 
# cd etc
# tail -10 rndc.conf | head -9 | sed s/#/ //g > named.conf

 

#cd /usr/local/named/etc

配置named.conf文件

 key "rndc-key" {
       algorithm hmac-md5;
       secret "jRCkX7915o21W9COW0ps4Q==";
 };

 controls {
       inet 127.0.0.1 port 953
               allow { 127.0.0.1; } keys { "rndc-key"; };
 };

acl "trusted" {
     61.178.241.0/24;
};

acl "CNC" {
   60.28.0.0/15;
   202.106.0.0/16;
   202.102.224.0/19;
   125.46.11.0/24;
   58.37.0.0/16;
   202.98.0.0/19;
   125.32.0.0/16;
   218.67.128.0/17;
   218.68.0.0/16;
   218.69.0.0/16;
   60.0.0.0/13;
   60.8.0.0/15;
   60.10.0.0/16;
   198.32.0.0/16;
   205.207.237.0/23;
   62.128.160.0/20;
   62.143.104.0/21;
   62.240.178.0/24;
   96.224.0.0/11;
   97.80.0.0/12;
   98.16.0.0/13;
   98.160.0.0/11;
   98.192.0.0/10;
   99.128.0.0/10;
   99.224.0.0/11;
   116.2.0.0/15;
   116.12.139.192/28;
   116.56.128.0/19;
   116.60.0.0/16;
   116.62.0.0/18;
   116.112.0.0/12;
   117.8.0.0/13;
   125.36.0.0/14;
   61.136.0.0/18;
   58.24.0.0/15;
   58.16.0.0/16;
58.17.0.0/17;
58.17.128.0/17;
58.18.0.0/16;
58.19.0.0/16;
58.21.0.0/16;
58.22.0.0/15;
58.144.0.0/16;
58.16.0.0/16;
58.17.0.0/17;
58.17.128.0/17;
58.18.0.0/16;
58.19.0.0/16;
58.21.0.0/16;
58.22.0.0/15;
58.16.0.0/16;
58.17.0.0/17;
58.17.128.0/17;
58.18.0.0/16;
58.19.0.0/16;
58.21.0.0/16;
58.144.0.0/16;
58.240.0.0/15;
58.244.0.0/15;
58.246.0.0/15;
60.0.0.0/13;
60.8.0.0/15;
60.13.0.0/18;
60.13.64.0/18;
60.13.128.0/17;
60.14.0.0/15;
60.16.0.0/13;
60.24.0.0/14;
60.31.0.0/16;
60.218.0.0/15;
60.220.0.0/14;
61.48.0.0/14;
61.52.0.0/15;
61.54.0.0/16;
61.55.0.0/16;
61.133.0.0/17;
61.134.128.0/18;
61.134.192.0/18;
61.135.0.0/16;
61.136.64.0/18;
61.137.128.0/17;
61.138.0.0/18;
61.138.64.0/18;
61.138.128.0/18;
61.139.128.0/18;
61.148.0.0/15;
61.156.0.0/16;
61.158.128.0/17;
61.159.0.0/18;
61.161.0.0/18;
61.161.128.0/17;
61.162.0.0/16;
61.163.0.0/16;
61.167.0.0/16;
61.168.0.0/16;
61.176.0.0/16;
61.179.0.0/16;
61.181.0.0/16;
61.182.0.0/16;
61.189.0.0/17;
113.0.0.0/13;
113.8.0.0/15;
114.240.0.0/12;
115.46.0.0/16;
115.48.0.0/12;
115.85.192.0/18;
116.2.0.0/15;
116.95.0.0/16;
116.112.0.0/14;
116.116.0.0/15;
117.8.0.0/13;
118.72.0.0/13;
118.80.0.0/15;
118.212.0.0/16;
119.4.0.0/14;
119.36.0.0/16;
119.39.0.0/16;
119.48.0.0/13;
119.62.0.0/16;
119.108.0.0/15;
119.112.0.0/13;
119.162.0.0/15;
119.164.0.0/14;
119.176.0.0/12;
119.248.0.0/14;
120.0.0.0/12;
120.80.0.0/13;
121.16.0.0/13;
121.24.0.0/14;
121.31.0.0/16;
122.96.0.0/15;
122.136.0.0/13;
122.156.0.0/14;
122.192.0.0/14;
123.4.0.0/14;
123.8.0.0/13;
123.112.0.0/12;
123.128.0.0/13;
123.138.0.0/15;
123.144.0.0/14;
123.148.0.0/16;
123.152.0.0/13;
123.188.0.0/14;
124.64.0.0/15;
124.66.0.0/17;
124.67.0.0/16;
124.88.0.0/16;
124.89.0.0/17;
124.89.128.0/17;
124.90.0.0/15;
124.92.0.0/14;
124.160.0.0/16;
124.161.0.0/16;
124.162.0.0/16;
124.163.0.0/16;
124.164.0.0/14;
125.32.0.0/16;
125.33.0.0/16;
125.34.0.0/16;
125.35.128.0/17;
125.36.0.0/14;
125.40.0.0/13;
125.211.0.0/16;
202.96.0.0/18;
202.96.64.0/21;
202.96.72.0/21;
202.97.128.0/18;
202.97.224.0/21;
202.97.240.0/20;
202.98.0.0/21;
202.98.8.0/21;
202.99.64.0/19;
202.99.96.0/21;
202.99.128.0/19;
202.99.160.0/21;
202.99.168.0/21;
202.99.176.0/20;
202.99.208.0/20;
202.99.224.0/21;
202.99.232.0/21;
202.99.240.0/20;
202.102.128.0/21;
202.102.224.0/21;
202.102.232.0/21;
202.102.240.0/20;
202.106.0.0/16;
202.107.0.0/17;
202.108.0.0/16;
202.110.0.0/18;
202.110.64.0/18;
202.111.128.0/19;
203.93.8.0/24;
203.93.64.0/18;
203.93.192.0/18;
210.13.0.0/18;
210.13.64.0/18;
210.13.128.0/17;
210.14.160.0/19;
210.14.192.0/19;
210.15.32.0/19;
210.15.96.0/19;
210.15.128.0/18;
210.21.0.0/17;
210.52.128.0/17;
210.53.0.0/17;
210.53.128.0/17;
210.82.0.0/15;
218.8.0.0/15;
218.10.0.0/16;
218.11.0.0/16;
218.12.0.0/16;
218.21.128.0/17;
218.24.0.0/15;
218.27.0.0/16;
218.56.0.0/14;
218.60.0.0/15;
218.67.128.0/17;
218.104.0.0/17;
218.104.128.0/19;
218.104.160.0/19;
218.104.192.0/21;
218.104.200.0/21;
218.105.0.0/16;
218.106.0.0/15;
219.154.0.0/15;
219.156.0.0/15;
219.158.0.0/17;
219.158.128.0/17;
219.159.0.0/18;
220.252.0.0/16;
221.0.0.0/15;
221.2.0.0/16;
221.3.0.0/17;
221.3.128.0/17;
221.4.0.0/16;
221.5.0.0/17;
221.5.128.0/17;
221.6.0.0/16;
221.7.0.0/19;
221.7.32.0/19;
221.7.64.0/19;
221.7.96.0/19;
221.7.128.0/17;
221.10.0.0/16;
221.11.0.0/17;
221.11.128.0/18;
221.11.224.0/19;
221.12.0.0/17;
221.12.128.0/18;
221.13.0.0/18;
221.13.64.0/19;
221.13.128.0/17;
221.14.0.0/15;
221.192.0.0/15;
221.194.0.0/16;
221.195.0.0/16;
221.196.0.0/15;
221.198.0.0/16;
221.199.0.0/19;
221.199.64.0/18;
221.199.128.0/18;
221.199.192.0/20;
221.199.224.0/19;
221.200.0.0/14;
221.204.0.0/15;
221.206.0.0/16;
221.207.0.0/18;
221.207.64.0/18;
221.207.128.0/17;
221.208.0.0/14;
221.212.0.0/16;
221.213.0.0/16;
221.216.0.0/13;
222.128.0.0/14;
222.132.0.0/14;
222.136.0.0/13;
222.160.0.0/15;
222.162.0.0/16;
222.163.0.0/19;
222.163.32.0/19;
222.163.64.0/18;
};

options {
        directory "/usr/local/named/var";
        pid-file "/usr/local/named/var/run/named.pid";
        /*
         * 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.
         */
         allow-transfer {61.178.0.94;202.100.64.81;};
         allow-recursion {trusted;};
         allow-query-cache { any; };
         query-source address * port 53;
};

view "cnc-group" {
match-clients { CNC; };
zone "." IN {
        type hint;
        file "named.ca";
};

zone "pub.gansudaily.com.cn" IN {
        type master;
        file "cnc.pub.gansudaily.com.cn";
};


zone "gansudaily.com.cn" IN {
        type master;
        file "cnc.gansudaily.com.cn";
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};

zone "241.178.61.in-addr.arpa" IN {
        type master;
        file "61.178.241.rev";
};
zone "84.100.202.in-addr.arpa" IN {
        type master;
        file "202.100.84.rev";
};

};

view "others" {
match-clients { any; };
zone "." IN {
        type hint;
        file "named.ca";
};

zone "pub.gansudaily.com.cn" IN {
        type master;
        file "pub.gansudaily.com.cn";
};


zone "gansudaily.com.cn" IN {
        type master;
        file "gansudaily.com.cn";
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};

zone "241.178.61.in-addr.arpa" IN {
        type master;
        file "61.178.241.rev";
};
zone "84.100.202.in-addr.arpa" IN {
        type master;
        file "202.100.84.rev";
};

};

 

配置named.local文件:

$TTL    900
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.

1       IN      PTR     localhost.

 

配置named.ca文件:

;       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
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    Dec 12, 2008
;       related version of root zone:   2008121200
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
A.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:BA3E::2:30
;
; FORMERLY NS1.ISI.EDU
;
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201
;
; 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
F.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2F::F
;
; 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
H.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:1::803F:235
;
; 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
J.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:C27::2:30
;
; OPERATED BY RIPE NCC
;
.                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
K.ROOT-SERVERS.NET.      3600000      AAAA  2001:7FD::1
;
; OPERATED BY ICANN
;
.                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     199.7.83.42
L.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:3::42  
;
; OPERATED BY WIDE
;
.                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
M.ROOT-SERVERS.NET.      3600000      AAAA  2001:DC3::35
; End of File

 

配置正向域gansudaily.com.cn文件:

;Database file gansudaily.com.cn.ns for gansudaily.com.cn zone.
;      Zone version:  282
;

@                       900     IN  SOA ns.gansudaily.com.cn.  webmaster.gansudaily.com.cn. (
                                282          ; serial number
                                28800        ; refresh
                                14400        ; retry
                                3600000      ; expire
                                86400      ) ; default TTL

;
;  Zone NS records
;

@                       IN      NS      ns.gansudaily.com.cn.
;
;  Zone records
;
@                       IN      A             202.100.84.234

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;dns server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ns                     900      IN     A      61.178.241.20

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;WWW server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
www                    900      IN     A      202.100.84.234
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;WWW virtual host
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
auto                    900     IN     CNAME  www.gansudaily.com.cn.
by                      900     IN     CNAME  www.gansudaily.com.cn.

 

配置反向域61.178.241.rev文件:

$ttl 38400
@       IN      SOA     dns.gansudaily.com.cn. root.mail2.gansudaily.com.cn. (
                        982660108
                        10800
                        3600
                        432000
                        38400 )
                IN      NS      ns.gansudaily.com.cn.
20      900     IN      PTR     ns.gansudaily.com.cn.
17      900     IN      PTR     work.gansudaily.com.cn.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值