DNS-Named 安装手册

简介

安装

 # yum install bind*

配置

配置 named.conf

options {
        listen-on port 53 { 127.0.0.1;192.168.40.200 };
        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;
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";
        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
 zone "docker.cloud.com" IN {
        type master;
        file "docker.cloud.com.zone";

};

zone "200.40.in-addr.arpa" IN {
        type master;
        file "200.40.zone";

};

$TTL 1D
@   IN SOA  ns.docker.cloud.com. root (
                    0   ; serial
                    1D  ; refresh
                    1H  ; retry
                    1W  ; expire
                    3H )    ; minimum
    IN NS ns.docker.cloud.com.
www IN A 192.168.40.200
ns IN A 192.168.40.200
@ IN A 192.168.40.200

备注: 在IN NS的开头必须要有4个空格

$TTL 1D
@   IN SOA  ns.docker.cloud.com. root (
                    0   ; serial
                    1D  ; refresh
                    1H  ; retry
                    1W  ; expire
                    3H )    ; minimum
@ IN NS ns.docker.cloud.com.
200 IN PTR www.docker.cloud.com.

启动named服务

 # systemctl start named

编译安装bind

*启动命令

/usr/local/named/sbin/named -4 -n 1 -S 52428
-4 :指定用于ipv4
-n:指定线程数为 1
-S:指定连接数 52428

结语