DNS区域文件验证

时间:2014-11-22 01:20:42

标签: dns bind zone

我在使用DNS绑定自己的名为check-checkzone的工具验证DNS区域文件时遇到了困难。

以下是DNS区域文件示例(sample.txt):

$TTL    86400 ; 24 hours could have been written as 24h or 1d
; $TTL used for all RRs without explicit TTL value
$ORIGIN example.com.
@  1D  IN  SOA ns1.example.com. hostmaster.example.com. (
                  2002022401 ; serial
                  3H ; refresh
                  15 ; retry
                  1w ; expire
                  3h ; minimum
                 )
       IN  NS     ns1.example.com. ; in the domain
       IN  NS     ns2.smokeyjoe.com. ; external to domain
       IN  MX  10 mail.another.com. ; external mail provider
; server host definitions
ns1    IN  A      192.168.0.1  ;name server definition     
www    IN  A      192.168.0.2  ;web server definition
ftp    IN  CNAME  www.example.com.  ;ftp server definition
; non server domain hosts
bill   IN  A      192.168.0.3
fred   IN  A      192.168.0.4

我正在运行的命令:

named-checkzone local sample.txt

但是,收到以下错误并且无法导致问题。

sample.txt:4: ignoring out-of-zone data (example.com)
sample.txt:15: ignoring out-of-zone data (ns1.example.com)
sample.txt:16: ignoring out-of-zone data (www.example.com)
sample.txt:17: ignoring out-of-zone data (ftp.example.com)
sample.txt:19: ignoring out-of-zone data (bill.example.com)
sample.txt:20: ignoring out-of-zone data (fred.example.com)
zone local/IN: has 0 SOA records
zone local/IN: has no NS records
zone local/IN: not loaded due to errors.

我感谢任何反馈/指示。

1 个答案:

答案 0 :(得分:4)

named-checkzone的第一个参数是区域名称。所以你要求它检查“本地”区域。而且example.com确实不在那个区域。