DNS Zone File Validation

4.6k views Asked by At

I am having difficulties validating DNS zone file using DNS Bind own tool named-checkzone.

Here is the sample DNS zone file (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

And the command I am running:

named-checkzone local sample.txt

However, getting the following error and unable to root cause the issue.

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.

I appreciate any feedback/pointers.

1

There are 1 answers

0
Calle Dybedahl On BEST ANSWER

The first argument to named-checkzone is the zone name. So you're asking it to check the zone "local". And example.com is indeed not in that zone.