码迷,mamicode.com
首页 > 其他好文 > 详细

RHEL 6.4 安装DNS服务(bind-9.8 )

时间:2014-10-27 19:47:24      阅读:620      评论:0      收藏:0      [点我收藏+]

标签:dns   redhat   bind   rhel   6.4   

首先安装yum,使用yum安装bind

yum install bind*

不同的操作系统rpm包有可能会不同
    bind-9.8.2-0.17.rc1.el6.x86_64
    bind-utils-9.8.2-0.17.rc1.el6.x86_64
    bind-chroot-9.8.2-0.17.rc1.el6.x86_64
    bind-dyndb-ldap-2.3-2.el6.x86_64
    bind-libs-9.8.2-0.17.rc1.el6.x86_64


几个rpm包安装之后,编辑named.conf

vim /etc/named.conf

options {
        listen-on port 53 { 127.0.0.1; };
        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; };
        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 "xiaoxiao.com" IN {
        type master;
        file "named.xiaoxiao.com";

};

zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "named.192.168.1";
};


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

:wq 保存退出


cd /var/named/

vim named.xiaoxiao.com


$TTL 3600
@       IN      SOA     demo.xiaoxiao.com. root.xiaoxiao.com. (
                                2014102401
                                1H
                                5M
                                1W
                                1D )
@               IN      NS      demo.xiaoxiao.com.
@               IN      MX  10  mail.xiaoxiao.com.
mail            IN      A       192.168.123.200
demo            IN      A       192.168.123.200
www             IN      A       192.168.123.200
ftp             IN      CNAME   demo.xiaoxiao.com.
:wq


vim named.192.168.1


$TTL 3600
@       IN      SOA     demo.xiaoxiao.com. root.xiaoxiao.com. (
                                                2014102402
                                                1H
                                                5M
                                                1w
                                                1D )
@       IN      NS      demo.xiaoxiao.com.
200     IN      PTR     demo.xiaoxiao.com.
200     IN      PTR     mail.xiaoxiao.com.
200     IN      PTR     www.xiaoxiao.com.
200     IN      PTR     ftp.xiaoxiao.com.


service named restart 重启DNS服务
Stopping named:                                            [  OK  ]
Starting named:                                            [  OK  ]
DNS服务已经正常启动。。。。。。。。。。。。。。。。。。。。。。。。。。


验证DNS服务:

[root@demo named]# nslookup
> xiaoxiao.com

本文出自 “消消” 博客,请务必保留此出处http://zhangxiaohua.blog.51cto.com/2321741/1568497

RHEL 6.4 安装DNS服务(bind-9.8 )

标签:dns   redhat   bind   rhel   6.4   

原文地址:http://zhangxiaohua.blog.51cto.com/2321741/1568497

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!