RHEL5.4下使用bind配置DNS服务器(4)


################################分割线 构建分离解析的域名服务器###########################
(1) 根据实验要求,搭建实验环境
(2) 修改主配置文件,创建视图和区域
vi /var/named/chroot/etc/named.conf
options
{
        listen-on port 53 { 192.168.1.102; 202.100.100.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; };
        recursion yes;
};
view "lan" {
        match-clients { 192.168.1.0/24; };
        zone "linuxidc.com" IN {
        type master;
        file "benet.zx";
   };
};
view "wan" {
        match-clients { any; };
        zone "linuxidc.com" IN {
        type master;
        file "benet.wan";
   };
};
(3) 分别建立对内、对外解析的区域数据库文件
cp -p localdomain.zone benet.zx
cp -p benet.zx benet.wan

vi /var/named/chroot/var/named/benet.zx
$TTL    86400
@               IN SOA linuxidc.com. root.linuxidc.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           ns1.linuxidc.com.
ns1     IN A            192.168.1.102
www     IN A            192.168.1.102

vi /var/named/chroot/var/named/benet.wan
$TTL    86400
@               IN SOA linuxidc.com. root.linuxidc.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           ns1.linuxidc.com.
ns1     IN A            202.100.100.1
www     IN A            202.100.100.1

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygwpj.html