初试DNS(bind9搭建)--Centos6平台

1.安装所需要的软件包

#yum install bind.i686 -y(i686为32位软件包)

#yum install bind-chroot.i686 -y

2.关闭防火墙(清楚规则)

#iptables -F

3.关闭SElinux(linux的安全内核)

#setenforce 0

4.配置主域名服务器

需求:www.qq.com 10.0.0.1

     mail.qq.com 10.0.0.2

     192.168.1.1 www.qq.com

      192.168.1.2 mail.qq.com

5.更新主配置文件

options {

//listen-on port 53 { 127.0.0.1; };

listen-on port 53 { any; };

//listen-on-v6 port 53 { ::1; };

directory "/var/named";

dump-file "/var/named/data/cache_dump.db";

       statistics-file "/var/named/data/named_stats.txt";

       memstatistics-file "/var/named/data/named_mem_stats.txt";

//allow-query     { localhost; };

allow-query     { any; };

recursion yes;


dnssec-enable yes;

dnssec-validation yes;

dnssec-lookaside auto;


/* Path to ISC DLV key */

bindkeys-file "/etc/named.iscdlv.key";


managed-keys-directory "/var/named/dynamic";

};


logging {

       channel default_debug {

               file "data/named.run";

               severity dynamic;

       };

};


zone "." IN {

type hint;

file "named.ca";

};

zone "qq.com" IN {

type master;

file "qq.com.zone";

};

zone "1.168.192.in-addr.arpa" IN {

type master;

file "192.168.1.rev";

};


include "/etc/named.rfc1912.zones";

include "/etc/named.root.key";


6.更新辅助配置文件192.168.1.rev(反向查询)

$TTL 1D

@IN SOA@ rname.invalid. (

                           0; serial

                           1D; refresh

                           1H; retry

                           1W; expire

                           3H ); minimum

   NS    dns.qq.com.

   A    127.0.0.1

   AAAA    ::1

1    IN    PTR    www.qq.com.

2    IN    PTR    ww.baidu.com.

7.更新辅助配置文件qq.com.zone(正向查询)

$TTL 1D

@IN SOA@ rname.invalid. (

0; serial

1D; refresh

1H; retry

1W; expire

3H ); minimum

NSdns

A127.0.0.1

AAAA::1

dns.qq.com.    IN    A    192.168.1.200

dns            IN    A    192.168.1.200

www            IN    A    10.0.0.1

mail           IN    A    10.0.0.2


v               IN    A    10.0.0.3

               IN    A    10.0.0.4

               IN    A    10.0.0.5


你可能感兴趣的:(bind9)