如何向具有不同 IP 地址的 DNS 服务器添加多个区域

如何向具有不同 IP 地址的 DNS 服务器添加多个区域

我有一个 DNS 服务器,其区域为 kevin.com: 192.168.1.11 和 marry.com: 192.168.1.210/etc/named.conf

zone "kevin.com" {
    type master;
    file "forward.kevin.com";
};
zone "marry.com"
{
    type master;
    file "forward.marry.com";
};

zone "1.168.192.in-addr.arpa" 
{
    type master;
    file "reverse.kevin.com; reverse.marry.com";
};

forward.kevin.com 文件:

$TTL    604800
@   IN  SOA server1.kevin.com. root.kevin.com. (
         2011071001   ;   Serial
                604800  ;   Refresh
                86400   ;   Retry
                2419200 ;   Expire
          86400 ;   Minimum Cache TTL
;
@   IN  NS  kevin.com.
@   IN  A   192.168.1.11
server1 IN A 192.168.1.11

reverse.kevin.com

$TTL    604800
@   IN  SOA server1.kevin.com. root.kevin.com. (
                2011071001   ;   Serial
                604800  ;   Refresh
                86400   ;   Retry
                2419200 ;   Expire
                86400 ;   Minimum Cache TTL
;
@   IN  NS  server1.kevin.com.
@  IN  PTR vnlab.com.
server1 IN A 192.168.1.11
11 IN PTR server1.kevin.com.

forward.marry.com

$TTL    604800
@   IN  SOA server1.marry.com. root.marry.com. (
                2011071001   ;   Serial
                604800  ;   Refresh
                86400   ;   Retry
                2419200 ;   Expire
               86400 ;   Minimum Cache TTL
;
@   IN  NS  server1.kevin.com.
@   IN  A   192.168.1.11
server1 IN A 192.168.1.210

reverse.marry.com

$TTL    604800
@   IN  SOA server1.marry.com. root.marry.com. (
                2011071001   ;   Serial
                604800  ;   Refresh
                86400   ;   Retry
                2419200 ;   Expire
                604800 ;   Minimum Cache TTL
;
@   IN  NS  server1.marry.com.
@  IN  PTR marry.com
server1 IN A 192.168.1.210
210 IN PTR server1.marry.com

当我尝试时service named restart出现错误

Loading from master file reverse.kevin.com; reverse.marry.com; failed: file not found

非常感谢您的帮助!提前致谢!

答案1

从反向文件中删除 A 记录。反向查找区域文件中只允许使用 ptr 记录。

相关内容