系统相关
首页 > 系统相关> > centos7-bind

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-esxi-hw01   IN      A       172.28.11.11
idc-esxi-hw02   IN      A       172.28.11.12
idc-esxi-hw03   IN  A   172.28.11.13
photon-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-esxi-hw01.zhcslyg.com
12  IN  PTR idc-esxi-hw02.zhcslyg.com
13  IN  PTR idc-esxi-hw03.zhcslyg.com
50      IN      PTR     photon-machine.zhcslyg.com
named-checkconf
systemctl restart named
systemctl enable named

标签:named,bind,centos7,172.28,esxi,test,com,idc
来源: https://www.cnblogs.com/kylingx/p/12194919.html