码迷,mamicode.com
首页 > 系统相关 > 详细

linux部署dns内网服务器

时间:2019-03-22 17:05:54      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:图片   org   sha   channel   loopback   sample   end   nim   dynamic   

安装: yum -y install bind*

编辑named.conf

vim /etc/named.conf

技术图片
options {
    listen-on port 53 { 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; };
    recursion yes;
#DNS转发配置
    forward first;
    forwarders {8.8.8.8;};

    dnssec-enable yes;
    dnssec-validation yes;

    /* 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 "dianelian.com" IN {
#    type master;
#    file "/var/named/test.dianelian.com";
#};

#zone "66.16.172.in-addr.arpa" IN {
#    type master;
#    file "dianelian.172.16.66.0";
#};


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

vim 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 http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (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; };
};

##电e连
#zone。配置域时请注意“;”分号。
zone "dianelian.com" IN {
type master;
file "test.dianelian.com.zone";
};
                
View Code

创建解析文件

vim test.dianelian.com.zone

技术图片
$TTL 3600
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
@       IN NS   172.16.66.152.
test    IN A    172.16.66.151
View Code

service iptables stop

chkconfig iptables off

service named start

linux部署dns内网服务器

标签:图片   org   sha   channel   loopback   sample   end   nim   dynamic   

原文地址:https://www.cnblogs.com/python-cat/p/10579042.html

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