centos7-bind

部署

yum install -y bind*
vim /etc/named.conf
listen-on port 53 { any; };
//  listen-on-v6 port 53 { ::1; }; 
allow-query     { any; };

配置转发,用于解析外网

recursion yes;
        forward first;
        forwarders {
            223.5.5.5;
            223.6.6.6;
         };
#include "/etc/named.root.key";

配置正向、反向解析

vim /etc/named.rfc1912.zones
zone "test.com" IN {
        type master;
        file "test.com.zone";
        allow-update { none; };
};

zone "11.28.172.in-addr.arpa" IN {
        type master;
        file "172.28.11.arpa";
        allow-update { none; };
};

解析文件位于/var/named

more test.com.zone
$TTL 1D
@	IN SOA	test.com. rname.invalid. (
					0	; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
                NS      @
                A       172.28.11.6

idc-hw01        IN      A       172.28.11.11
idc-hw02        IN      A       172.28.11.12
idc-hw03	IN	A	172.28.11.13
machine         IN      A       172.28.11.50
more 172.28.11.arpa
$TTL 1D
@	IN SOA	test.com. rname.invalid. (
					0	; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
        IN      NS	localhost.
6       IN      PTR     test.com
11	IN	PTR	idc-hw01.test.com
12	IN	PTR	idc-hw02.test.com
13	IN	PTR	idc-hw03.test.com
50      IN      PTR     machine.test.com
named-checkconf
systemctl restart named
systemctl enable named
posted @ 2020-01-15 08:46  kylingx  阅读(187)  评论(0编辑  收藏  举报