为主机的域创建 DNS 服务器

为主机的域创建 DNS 服务器

我想为域上的设置创建 DNS 服务器。

例如,我想要ns1.domain1.comns2.domain1.com每个域上设置这些时,域指向服务器并加载 apache 虚拟主机。

我在 CentOS 8 上尝试了以下操作,但我不知道接下来的步骤:

命名配置文件

options {
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
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     { any; };
allow-transfer  { none; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
};

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

zone "." IN {
   type hint;
   file "named.ca";
};
zone "aradteam.tk" IN {
   type master;
   file "forward.unixmen";
   allow-transfer { 195.248.242.31; };
};

zone "242.248.195.in-addr.arpa" IN {
   type master;
   file "reverse.unixmen";
   allow-transfer { 195.248.242.31; };
 };

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

转发.unixmen

$TTL 3H
@   IN SOA  @ hostmaster.aradteam.tk. (
                0   ; serial
                3H  ; refresh
                1H  ; retry
                1W  ; expire
                3H )    ; minimum
@            IN   NS     ns1.aradteam.tk.
@            IN   NS     ns2.aradteam.tk.
@            IN   A      195.248.242.31
@            IN   MX     10 host2.aradteam.tk.
@            IN   MX     20 host3.aradteam.tk.
ns1          IN   A      195.248.242.31
ns2          IN   A      195.248.242.31
host1        IN   A      195.248.242.31
host2        IN   A      195.248.242.31
host3        IN   A      195.248.242.31
www          IN   CNAME  aradteam.tk.
mail         IN   CNAME  host2.aradteam.tk.
gopher       IN   CNAME  host3.aradteam.tk.
aradteam.tk. IN   TXT    "v=spf1 ip4:203.0.113.42 include:_spf.google.com ~all"

反向.unixmen

$TTL 3H
@   IN SOA  @ hostmaster.aradteam.tk. (
                2    ; serial
                3H   ; refresh
                1H   ; retry
                1W   ; expire
                3H ) ; minimum
@        IN    NS    ns1.aradteam.tk.
@        IN    NS    ns2.aradteam.tk.
31        IN    PTR   ns1.aradteam.tk.
31        IN    PTR   ns2.aradteam.tk.

相关内容