未找到主机 xyz.org:3(NXDOMAIN)

未找到主机 xyz.org:3(NXDOMAIN)

我在 VM 上配置 DNS 时遇到一些问题...当我尝试运行命令时:host dns.xyz.org 出现错误:未找到 Host xyz.org:3(NXDOMAIN)

命名配置文件看起来像(不包括选项部分):

view "internal"
{
match-clients { 172.16.0.0/24; 127/8; };
recursion yes;
    zone "." IN {
     type hint;
     file "/var/named/named.ca";

}; 包括“/etc/named.rfc1912.zones”;

zone "xyz.org"{
     type master;
     file "internal/xyz.org";
     allow-transfer { 192.168.101.131;192.168.101.132; };
     allow-query { 172.16.0.0/24; };
};

zone "0.16.172.in-addr.arpa" IN {
     type master;
     file "internal/172.16.0.rev";
     allow-transfer { 192.168.101.131;192.168.101.132; };
     allow-query { 172.16.0.0/24; };
};

zone "101.168.192.in-addr.arpa" IN {
     type master;
     file "internal/192.168.101.rev";
     allow-transfer { 192.168.101.131;192.168.101.132; };
     allow-query { any; };
};
 };
 view "external"{

     match-clients { any; };
     recursion no;

     zone "xyz.org"{
         type master;
         file "external/xyz.org";
         allow-transfer { 192.168.101.131;192.168.101.132; };
         allow-query { any; };
     };

     zone "101.168.192.in-addr.arpa" IN {
         type master;
         file "external/192.168.101.rev";
         allow-transfer { 192.168.101.131;192.168.101.132; };
         allow-query { any; };
     };
};

解析配置文件

nameserver 192.168.101.131
search xyz.org

xyz.org

$TTL 1D

 @ IN SOA dns.gsr2011.org. webmaster.gsr2011.org.(
   20101018    ; serial
   43200        ; refresh = 12 hours
   1800        ; retry = 30 minutes
   1209600        ; expire = 2 weeks
   86400);         ; minimum = 1 day

   IN     TXT    "Test"
   IN    NS     dns.xyz.org.
   IN     NS     dns2.xyz.org.
   IN     MX 10    smtp.xyz.org.
   IN    MX 20    mail.xyz.org.

pop        IN    CNAME    mail
imap        IN    CNAME    mail

bd        IN    CNAME    master
ldap        IN    CNAME    voyager

dns            IN     A    172.16.0.1
voyager        IN    A    172.16.0.2
master        IN    A    172.16.0.3
dns2        IN    A    192.168.101.132
mail        IN    A    192.168.101.3
smtp        IN    A    192.168.101.4
web        IN    A    192.168.101.5

您能告诉我我是否遗漏了什么吗?我做错了什么?

答案1

好吧,一切都比看起来的要容易:D!

我在此部分将 192.168.101.131 更改为 127.0.0.1:

zone "xyz.org"{
 type master;
 file "internal/xyz.org";
 allow-transfer { 192.168.101.131;192.168.101.132; };
 allow-query { 172.16.0.0/24; };
};

我还删除了:

zone "." IN {
 type hint;
 file "/var/named/named.ca";

};
include "/etc/named.rfc1912.zones"; 

就是这样。

相关内容