CentOS 6.5 DNS 服务器搭建 Bind9.8.2

[root@www home]# yum -y install bind

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6 will be installed

--> Processing Dependency: bind-libs = 32:9.8.2-0.17.rc1.el6_4.6 for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Processing Dependency: portreserve for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Processing Dependency: liblwres.so.80()(64bit) for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Processing Dependency: libisccfg.so.82()(64bit) for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Processing Dependency: libisccc.so.80()(64bit) for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Processing Dependency: libisc.so.83()(64bit) for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Processing Dependency: libdns.so.81()(64bit) for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Processing Dependency: libbind9.so.80()(64bit) for package: 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64

--> Running transaction check

---> Package bind-libs.x86_64 32:9.8.2-0.17.rc1.el6_4.6 will be installed

---> Package portreserve.x86_64 0:0.0.4-9.el6 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

Package          Arch        Version                           Repository

                                                                          Size

================================================================================

Installing:

bind             x86_64      32:9.8.2-0.17.rc1.el6_4.6         base      4.0 M

Installing for dependencies:

bind-libs        x86_64      32:9.8.2-0.17.rc1.el6_4.6         base      878 k

portreserve      x86_64      0.0.4-9.el6                       base       23 k


Transaction Summary

================================================================================

Install       3 Package(s)


Total download size: 4.9 M

Installed size: 9.5 M

Downloading Packages:

(1/3): bind-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm            | 4.0 MB     00:00    

(2/3): bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm       | 878 kB     00:00    

(3/3): portreserve-0.0.4-9.el6.x86_64.rpm                |  23 kB     00:00    

--------------------------------------------------------------------------------

Total                                           5.1 MB/s | 4.9 MB     00:00    

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

 Installing : portreserve-0.0.4-9.el6.x86_64                               1/3

 Installing : 32:bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64                   2/3

 Installing : 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64                        3/3

 Verifying  : 32:bind-9.8.2-0.17.rc1.el6_4.6.x86_64                        1/3

 Verifying  : 32:bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64                   2/3

 Verifying  : portreserve-0.0.4-9.el6.x86_64                               3/3


Installed:

 bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6                                        


Dependency Installed:

 bind-libs.x86_64 32:9.8.2-0.17.rc1.el6_4.6  portreserve.x86_64 0:0.0.4-9.el6


Complete!

[root@archermind home]#



[root@www named]#vim /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
       listen-on port 53 { any; };   //改为any
      listen-on-v6 port 53 { any; };   //改为any
       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     { any; }; //改为 any
       recursion yes;

       dnssec-enable yes;
       dnssec-validation yes;
       dnssec-lookaside auto;

       /* Path to ISC DLV key */
       bindkeys-file "/etc/named.iscdlv.key";
};

logging {
       channel default_debug {
               file "data/named.run";
               severity dynamic;
       };
};

zone "." IN {
       type hint;
       file "named.ca";
};

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

//添加正反向
zone "hasee.com" IN {
       type master;
       file "hasee.com.zone";  
};
zone "1.168.192.in-addr.arpa" IN {
       type master;
       file "1.168.192.zone";
};
=========================================================

[root@www named]# pwd
/var/named/
[root@www named]#
[root@www named]#touch hasee.com.zone   ( 创建正向数据文件)
[root@www named]#touch 1.168.192.zone     (创建反向数据文件)
[root@www named]#vim hasee.com.zone
===========================================================================================
$TTL    86400
@       IN      SOA    ns.hasee.com. root.hasee.com. (
                       42        ; serial (d. adams)
                       3H        ; refresh
                       15M        ; retry
                       1W        ; expiry
                       1D )        ; minimum
@       IN       NS             ns.hasee.com.
ns      IN       A               192.168.1.8
www     IN       A               192.168.1.8
===========================================================================================
[root@www named]#vim 1.168.192.zone
===========================================================================================

$TTL    86400
@       IN      SOA     ns.hasee.com. root.hasee.com. (
                       1997022700 ; Serial
                       28800      ; Refresh
                       14400      ; Retry
                       3600000    ; Expire
                       86400 )    ; Minimum
@       IN      NS              ns.hasee.com.
8       IN      PTR             ns.hasee.com.

8       IN      PTR             www.hasee.com.

[root@www named]# rndc-confgen -r /dev/urandom -a

wrote key file "/etc/rndc.key"

[root@www named]# /etc/init.d/named start

Starting named: [  OK  ]

[root@www named]# /etc/init.d/iptables stop


你可能感兴趣的:(dns)