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

################################分割线 构建主域名服务器###########################
(1) 确定DNS服务器与需要解析的主机名和IP地址
DNS服务器:server01.linuxidc.com-->192.168.1.102
www服务器:>192.168.1.102
邮件服务器:mail.linuxidc.com-->192.168.1.105
主域服务器:ns1.linuxidc.com-->192.168.1.102
从域服务器:ns2.linuxidc.com-->192.168.1.103
(2) 创建正向区域和反向区域
vi /var/named/chroot/etc/named.conf
options
{
        listen-on port 53 { 192.168.1.102; };
        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 { 192.168.1.0/24; };
        recursion yes;
};
zone "linuxidc.com" IN {
        type master;
        file "net.zx";
};
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "net.fx";
};

(3) 创建正向和反向区域文件
通过参考localhost域的正反向区域文件创建区域文件
cd /var/named/chroot/var/named
cp -p localdomain.zone benet.zx
cp -p named.local benet.fx

vi 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
server01        IN A    192.168.1.102
mail    IN A            192.168.1.105
@       IN MX 10         mail.linuxidc.com.
ns2     IN A            192.168.1.103

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

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