Chinaunix首页 | 论坛 | 博客
  • 博客访问: 287920
  • 博文数量: 163
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: -40
  • 用 户 组: 普通用户
  • 注册时间: 2017-03-08 00:28
文章分类

全部博文(163)

文章存档

2015年(2)

2014年(35)

2013年(28)

2012年(30)

2011年(22)

2010年(14)

2009年(8)

2008年(13)

2007年(11)

分类: LINUX

2013-10-14 09:48:33

[root@www named]yum -y install bind     //升级安装的包
[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 { ::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     { 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";
=========================================================
==================================
[root@www named]# vim /etc/named.rfc1912.zones    //添加正反向区域
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "localhost.localdomain" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};
//注释这几行
//zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
//      type master;
//      file "named.loopback";
//      allow-update { none; };
//};

//zone "1.0.0.127.in-addr.arpa" IN {
//      type master;
//      file "named.loopback";
//      allow-update { none; };
//};            //注销这几行

zone "0.in-addr.arpa" IN {
        type master;
        file "named.empty";
        allow-update { none; };
};
//添加正反向
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/chroot/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            

原文地址: http://jin771998569.blog.51cto.com/2147853/756811
阅读(834) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~