centos7 部署内部dns

1.安装

sudo yum install bind -y

2.配置

cp /etc/named.conf /etc/named.conf.bak
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.bak
vim /etc/named.conf
vim /etc/named.rfc1912.zones
cd /var/named
cp -p named.localhost dlyphone.com
vim /var/named/dlyphone.com

options {
	listen-on port 53 { 127.0.0.1;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";
	recursing-file  "/var/named/data/named.recursing";
	secroots-file   "/var/named/data/named.secroots";
	allow-query     { localhost;any; };

	recursion yes;

	dnssec-enable yes;
	dnssec-validation yes;

	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.root.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 "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; };
};

zone "*****phone.com" IN {
        type master;
        file "***phone.com";
        allow-update { none; };
};

$TTL 1D
@       IN SOA  *****ne.com. adim.*****one.com. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
                IN      NS      ns1.*****one.com.
                IN      NS      ns2.*****one.com.
ns1             IN      A       127.0.0.1
ns2             IN      A       127.0.0.1
wafcdnapp       IN      A       10.6.234.117
apiyptest       IN      A       *.*.*.*
apiyp           IN      A       47.*.*.234
mtest           IN      A       47.*.*.98
www             IN      CNAME   www.*******.com.volcgslb.com.
m               IN      CNAME   m.*******.com.w.kunlunaq.com.

3.检查语法

named-checkconf /etc/named.conf 
named-checkconf /etc/named.rfc1912.zones

4.启动

systemctl enable named
systemctl start named
systemctl status named
posted @ 2024-10-23 16:20  六月OvO  阅读(3)  评论(0编辑  收藏  举报