xref: /netbsd-src/external/mpl/bind/dist/bin/check/named-compilezone.rst (revision f8cf1a9151c7af1cb0bd8b09c13c66bca599c027)
1.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
2..
3.. SPDX-License-Identifier: MPL-2.0
4..
5.. This Source Code Form is subject to the terms of the Mozilla Public
6.. License, v. 2.0.  If a copy of the MPL was not distributed with this
7.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
8..
9.. See the COPYRIGHT file distributed with this work for additional
10.. information regarding copyright ownership.
11
12.. highlight: console
13
14.. BEWARE: Do not forget to edit also named-checkzone.rst!
15
16.. iscman:: named-compilezone
17.. program:: named-compilezone
18.. _man_named-compilezone:
19
20named-compilezone - zone file converting tool
21---------------------------------------------
22
23Synopsis
24~~~~~~~~
25
26:program:`named-compilezone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {**-o** filename} {zonename} {filename}
27
28Description
29~~~~~~~~~~~
30
31:program:`named-compilezone` checks the syntax and integrity of a zone file,
32and dumps the zone contents to a specified file in a specified format.
33It applies strict check levels by default, since the
34dump output is used as an actual zone file loaded by :iscman:`named`.
35When manually specified otherwise, the check levels must at least be as
36strict as those specified in the :iscman:`named` configuration file.
37
38Options
39~~~~~~~
40
41.. option:: -d
42
43   This option enables debugging.
44
45.. option:: -h
46
47   This option prints the usage summary and exits.
48
49.. option:: -q
50
51   This option sets quiet mode, which only sets an exit code to indicate
52   successful or failed completion.
53
54.. option:: -v
55
56   This option prints the version of the :iscman:`named-checkzone` program and exits.
57
58.. option:: -j
59
60   When loading a zone file, this option tells :iscman:`named` to read the journal if it exists. The journal
61   file name is assumed to be the zone file name with the
62   string ``.jnl`` appended.
63
64.. option:: -J filename
65
66   When loading the zone file, this option tells :iscman:`named` to read the journal from the given file, if
67   it exists. This implies :option:`-j`.
68
69.. option:: -c class
70
71   This option specifies the class of the zone. If not specified, ``IN`` is assumed.
72
73.. option:: -i mode
74
75   This option performs post-load zone integrity checks. Possible modes are
76   ``full`` (the default), ``full-sibling``, ``local``,
77   ``local-sibling``, and ``none``.
78
79   Mode ``full`` checks that MX records refer to A or AAAA records
80   (both in-zone and out-of-zone hostnames). Mode ``local`` only
81   checks MX records which refer to in-zone hostnames.
82
83   Mode ``full`` checks that SRV records refer to A or AAAA records
84   (both in-zone and out-of-zone hostnames). Mode ``local`` only
85   checks SRV records which refer to in-zone hostnames.
86
87   Mode ``full`` checks that delegation NS records refer to A or AAAA
88   records (both in-zone and out-of-zone hostnames). It also checks that
89   glue address records in the zone match those advertised by the child.
90   Mode ``local`` only checks NS records which refer to in-zone
91   hostnames or verifies that some required glue exists, i.e., when the
92   name server is in a child zone.
93
94   Modes ``full-sibling`` and ``local-sibling`` disable sibling glue
95   checks, but are otherwise the same as ``full`` and ``local``,
96   respectively.
97
98   Mode ``none`` disables the checks.
99
100.. option:: -f format
101
102   This option specifies the format of the zone file. Possible formats are
103   ``text`` (the default), and ``raw``.
104
105.. option:: -F format
106
107   This option specifies the format of the output file specified. For
108   :iscman:`named-checkzone`, this does not have any effect unless it dumps
109   the zone contents.
110
111   Possible formats are ``text`` (the default), which is the standard
112   textual representation of the zone, and ``raw`` and ``raw=N``, which
113   store the zone in a binary format for rapid loading by :iscman:`named`.
114   ``raw=N`` specifies the format version of the raw zone file: if ``N`` is
115   0, the raw file can be read by any version of :iscman:`named`; if N is 1, the
116   file can only be read by release 9.9.0 or higher. The default is 1.
117
118.. option:: -k mode
119
120   This option performs ``check-names`` checks with the specified failure mode.
121   Possible modes are ``fail`` (the default), ``warn``, and ``ignore``.
122
123.. option:: -l ttl
124
125   This option sets a maximum permissible TTL for the input file. Any record with a
126   TTL higher than this value causes the zone to be rejected. This
127   is similar to using the ``max-zone-ttl`` option in :iscman:`named.conf`.
128
129.. option:: -L serial
130
131   When compiling a zone to ``raw`` format, this option sets the "source
132   serial" value in the header to the specified serial number. This is
133   expected to be used primarily for testing purposes.
134
135.. option:: -m mode
136
137   This option specifies whether MX records should be checked to see if they are
138   addresses. Possible modes are ``fail``, ``warn`` (the default), and
139   ``ignore``.
140
141.. option:: -M mode
142
143   This option checks whether a MX record refers to a CNAME. Possible modes are
144   ``fail``, ``warn`` (the default), and ``ignore``.
145
146.. option:: -n mode
147
148   This option specifies whether NS records should be checked to see if they are
149   addresses. Possible modes are ``fail`` (the default), ``warn``,  and
150   ``ignore``.
151
152.. option:: -o filename
153
154   This option writes the zone output to ``filename``. If ``filename`` is ``-``, then
155   the zone output is written to standard output. This is mandatory for :program:`named-compilezone`.
156
157.. option:: -r mode
158
159   This option checks for records that are treated as different by DNSSEC but are
160   semantically equal in plain DNS. Possible modes are ``fail``,
161   ``warn`` (the default), and ``ignore``.
162
163.. option:: -s style
164
165   This option specifies the style of the dumped zone file. Possible styles are
166   ``full`` (the default) and ``relative``. The ``full`` format is most
167   suitable for processing automatically by a separate script.
168   The relative format is more human-readable and is thus
169   suitable for editing by hand.
170
171.. option:: -S mode
172
173   This option checks whether an SRV record refers to a CNAME. Possible modes are
174   ``fail``, ``warn`` (the default), and ``ignore``.
175
176.. option:: -t directory
177
178   This option tells :iscman:`named` to chroot to ``directory``, so that ``include`` directives in the
179   configuration file are processed as if run by a similarly chrooted
180   :iscman:`named`.
181
182.. option:: -T mode
183
184   This option checks whether Sender Policy Framework (SPF) records exist and issues a
185   warning if an SPF-formatted TXT record is not also present. Possible
186   modes are ``warn`` (the default) and ``ignore``.
187
188.. option:: -w directory
189
190   This option instructs :iscman:`named` to chdir to ``directory``, so that relative filenames in master file
191   ``$INCLUDE`` directives work. This is similar to the directory clause in
192   :iscman:`named.conf`.
193
194.. option:: -D
195
196   This option dumps the zone file in canonical format. This is always enabled for
197   :program:`named-compilezone`.
198
199.. option:: -W mode
200
201   This option specifies whether to check for non-terminal wildcards. Non-terminal
202   wildcards are almost always the result of a failure to understand the
203   wildcard matching algorithm (:rfc:`4592`). Possible modes are ``warn``
204   (the default) and ``ignore``.
205
206.. option:: zonename
207
208   This indicates the domain name of the zone being checked.
209
210.. option:: filename
211
212   This is the name of the zone file.
213
214Return Values
215~~~~~~~~~~~~~
216
217:program:`named-compilezone` returns an exit status of 1 if errors were detected
218and 0 otherwise.
219
220See Also
221~~~~~~~~
222
223:iscman:`named(8) <named>`, :iscman:`named-checkconf(8) <named-checkconf>`, :iscman:`named-checkzone(8) <named-checkzone>`, :rfc:`1035`,
224BIND 9 Administrator Reference Manual.
225