由于要配置上千条二级域名,域名注册商提供的二级域名记录条数有上限,不支持我们的需求。只能自己干了。
安装就 yum install bind* 即可。
关键的地方是配置。
第一个配置文件:/etc/named.conf
options {
listen-on port 53 { 本机公网IP; };
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 { any; };
forwarders { 8.8.8.8;114.114.114.114; };
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has