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 .. _reference: 13 14 Configuration Reference 15 ======================= 16 17 The operational functionality of BIND 9 is defined using the file 18 **named.conf**, which is typically located in /etc or /usr/local/etc/namedb, 19 depending on the operating system or distribution. A further file **rndc.conf** 20 will be present if **rndc** is being run from a remote host, but is not required 21 if rndc is being run from **localhost** (the same system as BIND 9 is running 22 on). 23 24 .. _named_conf: 25 26 Configuration File (named.conf) 27 ------------------------------- 28 29 The file :file:`named.conf` may contain three types of entities: 30 31 .. glossary:: 32 33 Comment 34 :ref:`Multiple comment formats are supported <comment_syntax>`. 35 36 Block 37 :ref:`Blocks <configuration_blocks>` are containers for :term:`statements 38 <Statement>` which either have common functionality - for example, 39 the definition of a cryptographic key in a :namedconf:ref:`key` block - or which 40 define the scope of the statement - for example, a statement which appears 41 in a :namedconf:ref:`zone` block has scope only for that zone. 42 43 Blocks are organized hierarchically within :file:`named.conf` and may have a 44 number of different properties: 45 46 - Certain blocks cannot be nested inside other blocks and thus may be 47 regarded as the *topmost-level* blocks: for example, the 48 :namedconf:ref:`options` block and the :namedconf:ref:`logging` block. 49 50 - Certain blocks can appear multiple times, in which case they have 51 an associated name to disambiguate them: for example, the 52 :namedconf:ref:`zone` block (``zone example.com { ... };``) or the 53 :namedconf:ref:`key` block (``key mykey { ... };``). 54 55 - Certain blocks may be "nested" within other blocks. For example, the 56 :namedconf:ref:`zone` block may appear within a 57 :namedconf:ref:`view` block. 58 59 The description of each block in this manual lists its permissible locations. 60 61 Statement 62 - Statements define and control specific BIND behaviors. 63 - Statements may have a single parameter (a **Value**) or multiple parameters 64 (**Argument/Value** pairs). For example, the :any:`recursion` statement takes a 65 single value parameter - in this case, the string ``yes`` or ``no`` 66 (``recursion yes;``) - while the :namedconf:ref:`port` statement takes a numeric value 67 defining the DNS port number (``port 53;``). More complex statements take one or 68 more argument/value pairs. The :any:`also-notify` statement may take a number 69 of such argument/value pairs, such as ``also-notify port 5353;``, 70 where ``port`` is the argument and ``5353`` is the corresponding value. 71 - Statements can appear in a single :term:`block <Block>` - for 72 example, an :namedconf:ref:`algorithm` statement can appear only in a 73 :namedconf:ref:`key` block - or in multiple blocks - for example, an 74 :any:`also-notify` statement can appear in an :namedconf:ref:`options` 75 block where it has global (server-wide) scope, in a :any:`zone` 76 block where it has scope only for the specific zone (and overrides 77 any global statement), or even in a :any:`view` block where it has 78 scope for only that view (and overrides any global statement). 79 80 The file :file:`named.conf` may further contain one or more instances of the 81 :ref:`include <include_grammar>` **Directive**. This directive is provided for 82 administrative convenience in assembling a complete :file:`named.conf` file and plays 83 no subsequent role in BIND 9 operational characteristics or functionality. 84 85 .. Note:: 86 Over a period of many years the BIND ARM acquired a bewildering array of 87 terminology. Many of the terms used described similar concepts and served 88 only to add a layer of complexity, possibly confusion, and perhaps mystique 89 to BIND 9 configuration. The ARM now uses only the terms **Block**, 90 **Statement**, **Argument**, **Value**, and **Directive** to describe all 91 entities used in BIND 9 configuration. 92 93 .. _comment_syntax: 94 95 Comment Syntax 96 ~~~~~~~~~~~~~~ 97 98 The BIND 9 comment syntax allows comments to appear anywhere that 99 whitespace may appear in a BIND configuration file. To appeal to 100 programmers of all kinds, they can be written in the C, C++, or 101 shell/Perl style. 102 103 Syntax 104 ^^^^^^ 105 106 .. code-block:: none 107 108 /* This is a BIND comment as in C */ 109 110 .. code-block:: none 111 112 // This is a BIND comment as in C++ 113 114 .. code-block:: none 115 116 # This is a BIND comment as in common Unix shells 117 # and Perl 118 119 Definition and Usage 120 ^^^^^^^^^^^^^^^^^^^^ 121 122 Comments can be inserted anywhere that whitespace may appear in a BIND 123 configuration file. 124 125 C-style comments start with the two characters /\* (slash, star) and end 126 with \*/ (star, slash). Because they are completely delimited with these 127 characters, they can be used to comment only a portion of a line or to 128 span multiple lines. 129 130 C-style comments cannot be nested. For example, the following is not 131 valid because the entire comment ends with the first \*/: 132 133 .. code-block:: none 134 135 /* This is the start of a comment. 136 This is still part of the comment. 137 /* This is an incorrect attempt at nesting a comment. */ 138 This is no longer in any comment. */ 139 140 C++-style comments start with the two characters // (slash, slash) and 141 continue to the end of the physical line. They cannot be continued 142 across multiple physical lines; to have one logical comment span 143 multiple lines, each line must use the // pair. For example: 144 145 .. code-block:: none 146 147 // This is the start of a comment. The next line 148 // is a new comment, even though it is logically 149 // part of the previous comment. 150 151 Shell-style (or Perl-style) comments start with the 152 character ``#`` (number/pound sign) and continue to the end of the physical 153 line, as in C++ comments. For example: 154 155 .. code-block:: none 156 157 # This is the start of a comment. The next line 158 # is a new comment, even though it is logically 159 # part of the previous comment. 160 161 .. warning:: 162 163 The semicolon (``;``) character cannot start a comment, unlike 164 in a zone file. The semicolon indicates the end of a 165 configuration statement. 166 167 Configuration Layout Styles 168 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 169 170 BIND is very picky about opening and closing brackets/braces, semicolons, and 171 all the other separators defined in the formal syntaxes in later sections. 172 There are many layout styles that can assist in minimizing errors, as shown in 173 the following examples: 174 175 .. code-block:: none 176 177 // dense single-line style 178 zone "example.com" in{type secondary; file "secondary.example.com"; primaries {10.0.0.1;};}; 179 // single-statement-per-line style 180 zone "example.com" in{ 181 type secondary; 182 file "secondary.example.com"; 183 primaries {10.0.0.1;}; 184 }; 185 // spot the difference 186 zone "example.com" in{ 187 type secondary; 188 file "sec.secondary.com"; 189 primaries {10.0.0.1;}; }; 190 191 .. _include_grammar: 192 193 ``include`` Directive 194 ~~~~~~~~~~~~~~~~~~~~~ 195 196 .. code-block:: none 197 198 include filename; 199 200 .. _include_statement: 201 202 ``include`` Directive Definition and Usage 203 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 204 205 The include directive inserts the specified file (or files if a valid `glob 206 expression`_ is detected) at the point where the include directive is 207 encountered. The include directive facilitates the administration of 208 configuration files by permitting the reading or writing of some things but not 209 others. For example, the statement could include private keys that are readable 210 only by the name server. 211 212 .. _`glob expression`: https://man7.org/linux/man-pages/man7/glob.7.html 213 214 .. _address_match_lists: 215 216 Address Match Lists 217 ~~~~~~~~~~~~~~~~~~~ 218 219 Syntax 220 ^^^^^^ 221 222 An address match list is a list of semicolon-separated :term:`address_match_element` s. 223 224 :: 225 226 { <address_match_element>; ... }; 227 228 Each element is then defined as: 229 230 .. glossary:: 231 232 ``address_match_element`` 233 234 :: 235 236 [ ! ] ( <ip_address> | <netprefix> | key <server_key> | <acl_name> | { address_match_list } ) 237 238 Definition and Usage 239 ^^^^^^^^^^^^^^^^^^^^ 240 241 Address match lists are primarily used to determine access control for 242 various server operations. They are also used in the :any:`listen-on` and 243 :any:`sortlist` statements. The elements which constitute an address match 244 list can be any of the following: 245 246 - :term:`ip_address`: an IP address (IPv4 or IPv6) 247 248 - :term:`netprefix`: an IP prefix (in ``/`` notation) 249 250 - :term:`server_key`: a key ID, as defined by the ``key`` statement 251 252 - :term:`acl_name`: the name of an address match list defined with the :any:`acl` statement 253 254 - a nested address match list enclosed in braces 255 256 Elements can be negated with a leading exclamation mark (``!``), and the 257 match list names "any", "none", "localhost", and "localnets" are 258 predefined. More information on those names can be found in the 259 description of the :any:`acl` statement. 260 261 The addition of the key clause made the name of this syntactic element 262 something of a misnomer, since security keys can be used to validate 263 access without regard to a host or network address. Nonetheless, the 264 term "address match list" is still used throughout the documentation. 265 266 When a given IP address or prefix is compared to an address match list, 267 the comparison takes place in approximately O(1) time. However, key 268 comparisons require that the list of keys be traversed until a matching 269 key is found, and therefore may be somewhat slower. 270 271 The interpretation of a match depends on whether the list is being used 272 for access control, defining :any:`listen-on` ports, or in a :any:`sortlist`, 273 and whether the element was negated. 274 275 When used as an access control list, a non-negated match allows access 276 and a negated match denies access. If there is no match, access is 277 denied. The clauses :any:`allow-notify`, :any:`allow-recursion`, 278 :any:`allow-recursion-on`, :any:`allow-query`, :any:`allow-query-on`, 279 :any:`allow-query-cache`, :any:`allow-query-cache-on`, :any:`allow-transfer`, 280 :any:`allow-update`, :any:`allow-update-forwarding`, and :any:`blackhole` 281 all use address match lists. Similarly, the 282 :any:`listen-on` option causes the server to refuse queries on any of 283 the machine's addresses which do not match the list. 284 285 Order of insertion is significant. If more than one element in an ACL is 286 found to match a given IP address or prefix, preference is given to 287 the one that came *first* in the ACL definition. Because of this 288 first-match behavior, an element that defines a subset of another 289 element in the list should come before the broader element, regardless 290 of whether either is negated. For example, in ``1.2.3/24; ! 1.2.3.13;`` 291 the 1.2.3.13 element is completely useless because the algorithm 292 matches any lookup for 1.2.3.13 to the 1.2.3/24 element. Using 293 ``! 1.2.3.13; 1.2.3/24`` fixes that problem by blocking 1.2.3.13 294 via the negation, but all other 1.2.3.\* hosts pass through. 295 296 297 Glossary of Terms Used 298 ~~~~~~~~~~~~~~~~~~~~~~ 299 300 Following is a list of terms used throughout the BIND configuration 301 file documentation: 302 303 .. glossary:: 304 305 ``acl_name`` 306 The name of an :term:`address_match_list` as defined by the :any:`acl` statement. 307 308 ``address_match_list`` 309 See :ref:`address_match_lists`. 310 311 ``boolean`` 312 Either ``yes`` or ``no``. The words ``true`` and ``false`` are also accepted, as are the numbers ``1`` and ``0``. 313 314 ``domain_name`` 315 A quoted string which is used as a DNS name; for example: ``my.test.domain``. 316 317 ``duration`` 318 A duration in BIND 9 can be written in three ways: as a single number 319 representing seconds, as a string of numbers with TTL-style 320 time-unit suffixes, or in ISO 6801 duration format. 321 322 Allowed TTL time-unit suffixes are: "W" (week), "D" (day), "H" (hour), 323 "M" (minute), and "S" (second). Examples: "1W" (1 week), "3d12h" 324 (3 days, 12 hours). 325 326 ISO 8601 duration format consists of the letter "P", followed by an 327 optional series of numbers with unit suffixes "Y" (year), "M" (month), 328 "W" (week), and "D" (day); this may optionally be followed by the 329 letter "T", and another series of numbers with unit suffixes 330 "H" (hour), "M" (minute), and "S" (second). Examples: "P3M10D" 331 (3 months, 10 days), "P2WT12H" (2 weeks, 12 hours), "pt15m" 332 (15 minutes). For more information on ISO 8601 duration format, 333 see :rfc:`3339`, appendix A. 334 335 Both TTL-style and ISO 8601 duration formats are case-insensitive. 336 337 ``fixedpoint`` 338 A non-negative real number that can be specified to the nearest one-hundredth. Up to five digits can be specified before a decimal point, and up to two digits after, so the maximum value is 99999.99. Acceptable values might be further limited by the contexts in which they are used. 339 340 ``integer`` 341 A non-negative 32-bit integer (i.e., a number between 0 and 4294967295, inclusive). Its acceptable value might be further limited by the context in which it is used. 342 343 ``ip_address`` 344 An :term:`ipv4_address` or :term:`ipv6_address`. 345 346 ``ipv4_address`` 347 An IPv4 address with exactly four integer elements valued 0 through 255 348 and separated by dots (``.``), such as ``192.168.1.1`` (a 349 "dotted-decimal" notation with all four elements present). 350 351 ``ipv6_address`` 352 An IPv6 address, such as ``2001:db8::1234``. IPv6-scoped addresses that have ambiguity on their scope zones must be disambiguated by an appropriate zone ID with the percent character (``%``) as a delimiter. It is strongly recommended to use string zone names rather than numeric identifiers, to be robust against system configuration changes. However, since there is no standard mapping for such names and identifier values, only interface names as link identifiers are supported, assuming one-to-one mapping between interfaces and links. For example, a link-local address ``fe80::1`` on the link attached to the interface ``ne0`` can be specified as ``fe80::1%ne0``. Note that on most systems link-local addresses always have ambiguity and need to be disambiguated. 353 354 ``netprefix`` 355 An IP network specified as an :term:`ip_address`, followed by a slash (``/``) and then the number of bits in the netmask. Trailing zeros in an :term:`ip_address` may be omitted. For example, ``127/8`` is the network ``127.0.0.0`` with netmask ``255.0.0.0`` and ``1.2.3.0/28`` is network ``1.2.3.0`` with netmask ``255.255.255.240``. 356 When specifying a prefix involving an IPv6-scoped address, the scope may be omitted. In that case, the prefix matches packets from any scope. 357 358 ``percentage`` 359 An integer value followed by ``%`` to represent percent. 360 361 ``port`` 362 An IP port :term:`integer`. It is limited to 0 through 65535, with values below 1024 typically restricted to use by processes running as root. In some cases, an asterisk (``*``) character can be used as a placeholder to select a random high-numbered port. 363 364 ``portrange`` 365 A list of a :term:`port` or a port range. A port range is specified in the form of ``range`` followed by two :term:`port` s, ``port_low`` and ``port_high``, which represents port numbers from ``port_low`` through ``port_high``, inclusive. ``port_low`` must not be larger than ``port_high``. For example, ``range 1024 65535`` represents ports from 1024 through 65535. The asterisk (``*``) character is not allowed as a valid :term:`port` or as a port range boundary. 366 367 ``server-list`` 368 A named list of one or more :term:`ip_address` es with optional :term:`tls_id`, :term:`server_key`, and/or :term:`port`. A ``server-list`` list may include other ``server-list`` lists. 369 370 ``server_key`` 371 A :term:`domain_name` representing the name of a shared key, to be used for 372 :ref:`transaction security <tsig>`. Keys are defined using 373 :namedconf:ref:`key` blocks. 374 375 ``size`` 376 ``sizeval`` 377 A 64-bit unsigned integer. Integers may take values 0 <= value <= 18446744073709551615, though certain parameters (such as :any:`max-journal-size`) may use a more limited range within these extremes. In most cases, setting a value to 0 does not literally mean zero; it means "undefined" or "as big as possible," depending on the context. See the explanations of particular parameters that use ``size`` for details on how they interpret its use. Numeric values can optionally be followed by a scaling factor: ``K`` or ``k`` for kilobytes, ``M`` or ``m`` for megabytes, and ``G`` or ``g`` for gigabytes, which scale by 1024, 1024*1024, and 1024*1024*1024 respectively. 378 379 Some statements also accept the keywords ``unlimited`` or ``default``: 380 ``unlimited`` generally means "as big as possible," and is usually the best way to safely set a very large number. 381 ``default`` uses the limit that was in force when the server was started. 382 383 ``tls_id`` 384 A named TLS configuration object which defines a TLS key and certificate. See :any:`tls` block. 385 386 387 .. _configuration_file_grammar: 388 389 .. _configuration_blocks: 390 391 Blocks 392 ------ 393 394 A BIND 9 configuration consists of blocks, statements, and comments. 395 396 The following blocks are supported: 397 398 :any:`acl` 399 Defines a named IP address matching list, for access control and other uses. 400 401 :any:`controls` 402 Declares control channels to be used by the :iscman:`rndc` utility. 403 404 :any:`dnssec-policy` 405 Describes a DNSSEC key and signing policy for zones. See :any:`dnssec-policy` for details. 406 407 :namedconf:ref:`key` 408 Specifies key information for use in authentication and authorization using TSIG. 409 410 :any:`key-store` 411 Describes a DNSSEC key store. See :ref:`key-store Grammar <key_store_grammar>` for details. 412 413 :any:`logging` 414 Specifies what information the server logs and where the log messages are sent. 415 416 :namedconf:ref:`options` 417 Controls global server configuration options and sets defaults for other statements. 418 419 :namedconf:ref:`remote-servers` 420 Defines a named list of servers for inclusion in various zone statements such as :any:`parental-agents`, :any:`primaries` or :any:`also-notify` lists. 421 422 :namedconf:ref:`server` 423 Sets certain configuration options on a per-server basis. 424 425 :any:`statistics-channels` 426 Declares communication channels to get access to :iscman:`named` statistics. 427 428 :any:`tls` 429 Specifies configuration information for a TLS connection, including a :any:`key-file`, :any:`cert-file`, :any:`ca-file`, :any:`dhparam-file`, :any:`remote-hostname`, :any:`ciphers`, :any:`protocols`, :any:`prefer-server-ciphers`, and :any:`session-tickets`. 430 431 :any:`http` 432 Specifies configuration information for an HTTP connection, including :any:`endpoints`, :any:`listener-clients`, and :any:`streams-per-connection`. 433 434 :any:`trust-anchors` 435 Defines DNSSEC trust anchors: if used with the ``initial-key`` or ``initial-ds`` keyword, trust anchors are kept up-to-date using :rfc:`5011` trust anchor maintenance; if used with ``static-key`` or ``static-ds``, keys are permanent. 436 437 :any:`managed-keys` 438 Is identical to :any:`trust-anchors`; this option is deprecated in favor of :any:`trust-anchors` with the ``initial-key`` keyword, and may be removed in a future release. 439 440 :any:`trusted-keys` 441 Defines permanent trusted DNSSEC keys; this option is deprecated in favor of :any:`trust-anchors` with the ``static-key`` keyword, and may be removed in a future release. 442 443 :any:`view` 444 Defines a view. 445 446 :any:`zone` 447 Defines a zone. 448 449 The :any:`logging` and :namedconf:ref:`options` statements may only occur once per 450 configuration. 451 452 :any:`acl` Block Grammar 453 ~~~~~~~~~~~~~~~~~~~~~~~~~ 454 455 .. namedconf:statement:: acl 456 :tags: server 457 :short: Assigns a symbolic name to an address match list. 458 459 :any:`acl` Block Definition and Usage 460 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 461 462 The :any:`acl` statement assigns a symbolic name to an address match list. 463 It gets its name from one of the primary uses of address match lists: Access 464 Control Lists (ACLs). 465 466 The following ACLs are built-in: 467 468 ``any`` 469 Matches all hosts. 470 471 ``none`` 472 Matches no hosts. 473 474 ``localhost`` 475 Matches the IPv4 and IPv6 addresses of all network interfaces on the system. When addresses are added or removed, the ``localhost`` ACL element is updated to reflect the changes. 476 477 ``localnets`` 478 Matches any host on an IPv4 or IPv6 network for which the system has an interface. When addresses are added or removed, the ``localnets`` ACL element is updated to reflect the changes. Some systems do not provide a way to determine the prefix lengths of local IPv6 addresses; in such cases, ``localnets`` only matches the local IPv6 addresses, just like ``localhost``. 479 480 :any:`controls` Block Grammar 481 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 482 .. namedconf:statement:: controls 483 :tags: server 484 :short: Specifies control channels to be used to manage the name server. 485 486 :any:`controls` Block Definition and Usage 487 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 488 489 The :any:`controls` statement declares control channels to be used by 490 system administrators to manage the operation of the name server. These 491 control channels are used by the :iscman:`rndc` utility to send commands to 492 and retrieve non-DNS results from a name server. 493 494 .. namedconf:statement:: unix 495 :tags: obsolete 496 :short: Specifies a Unix domain socket as a control channel. 497 498 This option has been removed and using it will cause a fatal error. 499 500 .. namedconf:statement:: inet 501 :tags: server 502 :short: Specifies a TCP socket as a control channel. 503 504 An :any:`inet` control channel is a TCP socket listening at the specified 505 :term:`port` on the specified :term:`ip_address`, which can be an IPv4 or IPv6 506 address. An :term:`ip_address` of ``*`` (asterisk) is interpreted as the IPv4 507 wildcard address; connections are accepted on any of the system's 508 IPv4 addresses. To listen on the IPv6 wildcard address, use an 509 :term:`ip_address` of ``::``. If :iscman:`rndc` is only used on the local host, 510 using the loopback address (``127.0.0.1`` or ``::1``) is recommended for 511 maximum security. 512 513 If no port is specified, port 953 is used. The asterisk ``*`` cannot 514 be used for :term:`port`. 515 516 The ability to issue commands over the control channel is restricted by 517 the ``allow`` and :any:`keys` clauses. 518 519 ``allow`` 520 Connections to the control channel 521 are permitted based on the :term:`address_match_list`. This is for simple IP 522 address-based filtering only; any :term:`server_key` elements of the 523 :term:`address_match_list` are ignored. 524 525 :any:`keys` 526 The primary authorization mechanism of the command channel is the 527 list of :term:`server_key` s. Each listed 528 :namedconf:ref:`key` is authorized to execute commands over the control 529 channel. See :ref:`admin_tools` for information about 530 configuring keys in :iscman:`rndc`. 531 532 533 ``read-only`` 534 If the ``read-only`` argument is ``on``, the control channel is limited 535 to the following set of read-only commands: ``nta -dump``, :any:`null`, 536 ``status``, ``showzone``, ``testgen``, and ``zonestatus``. By default, 537 ``read-only`` is not enabled and the control channel allows read-write 538 access. 539 540 If no :any:`controls` statement is present, :iscman:`named` sets up a default 541 control channel listening on the loopback address 127.0.0.1 and its IPv6 542 counterpart, ::1. In this case, and also when the :any:`controls` statement 543 is present but does not have a :any:`keys` clause, :iscman:`named` attempts 544 to load the command channel key from the file |rndc_key|. 545 To create an ``rndc.key`` file, run :option:`rndc-confgen -a`. 546 547 To disable the command channel, use an empty :any:`controls` statement: 548 ``controls { };``. 549 550 551 ``key`` Block Grammar 552 ~~~~~~~~~~~~~~~~~~~~~~~~~ 553 .. namedconf:statement:: key 554 :tags: security 555 :short: Defines a shared secret key for use with :ref:`tsig` or the command channel. 556 557 ``key`` Block Definition and Usage 558 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 559 560 The ``key`` statement defines a shared secret key for use with TSIG (see 561 :ref:`tsig`) or the command channel (see :any:`controls`). 562 563 The ``key`` statement can occur at the top level of the configuration 564 file or inside a :any:`view` statement. Keys defined in top-level ``key`` 565 statements can be used in all views. Keys intended for use in a 566 :any:`controls` statement must be defined at the top level. 567 568 The :term:`server_key`, also known as the key name, is a domain name that uniquely 569 identifies the key. It can be used in a :namedconf:ref:`server` statement to cause 570 requests sent to that server to be signed with this key, or in address 571 match lists to verify that incoming requests have been signed with a key 572 matching this name, algorithm, and secret. 573 574 .. namedconf:statement:: algorithm 575 :tags: security 576 :short: Defines the algorithm to be used in a key clause. 577 578 The ``algorithm_id`` is a string that specifies a security/authentication 579 algorithm. The :iscman:`named` server supports ``hmac-md5``, ``hmac-sha1``, 580 ``hmac-sha224``, ``hmac-sha256``, ``hmac-sha384``, and ``hmac-sha512`` 581 TSIG authentication. Truncated hashes are supported by appending the 582 minimum number of required bits preceded by a dash, e.g., 583 ``hmac-sha1-80``. 584 585 .. namedconf:statement:: secret 586 :tags: security 587 :short: Defines a Base64-encoded string to be used as the secret by the algorithm. 588 589 The ``secret_string`` is the secret to be used by the 590 algorithm, and is treated as a Base64-encoded string. 591 592 .. _key_store_grammar: 593 594 :any:`key-store` Block Grammar 595 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 596 .. namedconf:statement:: key-store 597 :tags: dnssec 598 :short: Configures a DNSSEC key store. 599 600 .. _key_store_statement: 601 602 ``key-store`` Block Definition and Usage 603 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 604 605 The ``key-store`` statement defines how DNSSEC keys should be stored. 606 607 There is one built-in key store named ``key-directory``. Configuring 608 keys to use ``key-store "key-directory"`` is identical to using 609 ``key-directory``. 610 611 The following options can be specified in a :any:`key-store` statement: 612 613 .. directory 614 615 The ``directory`` specifies where key files for this key should be stored. 616 This is similar to using the zone's ``key-directory``. 617 618 .. namedconf:statement:: pkcs11-uri 619 :tags: dnssec, pkcs11 620 621 The ``uri`` is a string that specifies a PKCS#11 URI Scheme (defined in 622 :rfc:`7512`). When set, :iscman:`named` tries to create keys inside the 623 corresponding PKCS#11 token. This requires BIND to be built with OpenSSL 3, 624 and to have a PKCS#11 provider configured. 625 626 .. _logging_grammar: 627 628 :any:`logging` Block Grammar 629 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 630 .. namedconf:statement:: logging 631 :tags: logging 632 :short: Configures logging options for the name server. 633 634 :any:`logging` Block Definition and Usage 635 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 636 637 The :any:`logging` statement configures a wide variety of logging options 638 for the name server. Its :any:`channel` phrase associates output methods, 639 format options, and severity levels with a name that can then be used 640 with the :any:`category` phrase to select how various classes of messages 641 are logged. 642 643 Only one :any:`logging` statement is used to define as many channels and 644 categories as desired. If there is no :any:`logging` statement, the 645 logging configuration is: 646 647 :: 648 649 logging { 650 category default { default_syslog; default_debug; }; 651 category unmatched { null; }; 652 }; 653 654 If :iscman:`named` is started with the :option:`-L <named -L>` option, it logs to the specified 655 file at startup, instead of using syslog. In this case the logging 656 configuration is: 657 658 :: 659 660 logging { 661 category default { default_logfile; default_debug; }; 662 category unmatched { null; }; 663 }; 664 665 The logging configuration is only established when the entire 666 configuration file has been parsed. When the server starts up, all 667 logging messages regarding syntax errors in the configuration file go to 668 the default channels, or to standard error if the :option:`-g <named -g>` option was 669 specified. 670 671 The :any:`channel` Phrase 672 ^^^^^^^^^^^^^^^^^^^^^^^^^ 673 .. namedconf:statement:: channel 674 :tags: logging 675 :short: Defines a stream of data that can be independently logged. 676 677 All log output goes to one or more ``channels``; there is no limit to 678 the number of channels that can be created. 679 680 Every channel definition must include a destination clause that says 681 whether messages selected for the channel go to a file, go to a particular 682 syslog facility, go to the standard error stream, or are discarded. The definition can 683 optionally also limit the message severity level that is accepted 684 by the channel (the default is ``info``), and whether to include a 685 :iscman:`named`-generated time stamp, the category name, and/or the severity level 686 (the default is not to include any). 687 688 .. namedconf:statement:: null 689 :tags: logging 690 :short: Causes all messages sent to the logging channel to be discarded. 691 692 The :any:`null` destination clause causes all messages sent to the channel 693 to be discarded; in that case, other options for the channel are 694 meaningless. 695 696 ``file`` 697 The ``file`` destination clause directs the channel to a disk file. It 698 can include additional arguments to specify how large the file is 699 allowed to become before it is rolled to a backup file (``size``), how 700 many backup versions of the file are saved each time this happens 701 (``versions``), and the format to use for naming backup versions 702 (``suffix``). 703 704 The ``size`` option is used to limit log file growth. If the file ever 705 exceeds the specified size, then :iscman:`named` stops writing to the file 706 unless it has a ``versions`` option associated with it. If backup 707 versions are kept, the files are rolled as described below. If there is 708 no ``versions`` option, no more data is written to the log until 709 some out-of-band mechanism removes or truncates the log to less than the 710 maximum size. The default behavior is not to limit the size of the file. 711 712 File rolling only occurs when the file exceeds the size specified with 713 the ``size`` option. No backup versions are kept by default; any 714 existing log file is simply appended. The ``versions`` option specifies 715 how many backup versions of the file should be kept. If set to 716 ``unlimited``, there is no limit. 717 718 The ``suffix`` option can be set to either ``increment`` or 719 ``timestamp``. If set to ``timestamp``, then when a log file is rolled, 720 it is saved with the current timestamp as a file suffix. If set to 721 ``increment``, then backup files are saved with incrementing numbers as 722 suffixes; older files are renamed when rolling. For example, if 723 ``versions`` is set to 3 and ``suffix`` to ``increment``, then when 724 ``filename.log`` reaches the size specified by ``size``, 725 ``filename.log.1`` is renamed to ``filename.log.2``, ``filename.log.0`` 726 is renamed to ``filename.log.1``, and ``filename.log`` is renamed to 727 ``filename.log.0``, whereupon a new ``filename.log`` is opened. 728 729 Here is an example using the ``size``, ``versions``, and ``suffix`` options: 730 731 :: 732 733 channel an_example_channel { 734 file "example.log" versions 3 size 20m suffix increment; 735 print-time yes; 736 print-category yes; 737 }; 738 739 .. namedconf:statement:: syslog 740 :tags: logging 741 :short: Directs the logging channel to the system log. 742 743 The :any:`syslog` destination clause directs the channel to the system log. 744 Its argument is a syslog facility as described in the :any:`syslog` man 745 page. Known facilities are ``kern``, ``user``, ``mail``, ``daemon``, 746 ``auth``, :any:`syslog`, ``lpr``, ``news``, ``uucp``, ``cron``, 747 ``authpriv``, ``ftp``, ``local0``, ``local1``, ``local2``, ``local3``, 748 ``local4``, ``local5``, ``local6``, and ``local7``; however, not all 749 facilities are supported on all operating systems. How :any:`syslog` 750 handles messages sent to this facility is described in the 751 ``syslog.conf`` man page. On a system which uses a very old 752 version of :any:`syslog`, which only uses two arguments to the ``openlog()`` 753 function, this clause is silently ignored. 754 755 .. namedconf:statement:: severity 756 :tags: logging 757 :short: Defines the priority level of log messages. 758 759 The :any:`severity` clause works like :any:`syslog`'s "priorities," except 760 that they can also be used when writing straight to a file rather 761 than using :any:`syslog`. Messages which are not at least of the severity 762 level given are not selected for the channel; messages of higher 763 severity levels are accepted. 764 765 When using :any:`syslog`, the ``syslog.conf`` priorities 766 also determine what eventually passes through. For example, defining a 767 channel facility and severity as ``daemon`` and ``debug``, but only 768 logging ``daemon.warning`` via ``syslog.conf``, causes messages of 769 severity ``info`` and ``notice`` to be dropped. If the situation were 770 reversed, with :iscman:`named` writing messages of only ``warning`` or higher, 771 then ``syslogd`` would print all messages it received from the channel. 772 773 .. namedconf:statement:: stderr 774 :tags: logging 775 :short: Directs the logging channel output to the server's standard error stream. 776 777 The :any:`stderr` destination clause directs the channel to the server's 778 standard error stream. This is intended for use when the server is 779 running as a foreground process, as when debugging a 780 configuration, for example. 781 782 The server can supply extensive debugging information when it is in 783 debugging mode. If the server's global debug level is greater than zero, 784 debugging mode is active. The global debug level is set either 785 by starting the :iscman:`named` server with the :option:`-d <named -d>` flag followed by a 786 positive integer, or by running :option:`rndc trace`. The global debug level 787 can be set to zero, and debugging mode turned off, by running ``rndc 788 notrace``. All debugging messages in the server have a debug level; 789 higher debug levels give more detailed output. Channels that indicate a specific debug severity 790 get debugging output of level 3 or less any time the server is in 791 debugging mode, regardless of the global debugging level: 792 793 :: 794 795 channel specific_debug_level { 796 file "foo"; 797 severity debug 3; 798 }; 799 800 Channels with 801 ``dynamic`` severity use the server's global debug level to determine 802 which messages to print. 803 804 .. namedconf:statement:: print-time 805 :tags: logging 806 :short: Specifies the time format for log messages. 807 808 :any:`print-time` can be set to ``yes``, ``no``, or a time format 809 specifier, which may be one of ``local``, ``iso8601``, or 810 ``iso8601-utc``. If set to ``no``, the date and time are not 811 logged. If set to ``yes`` or ``local``, the date and time are logged in 812 a human-readable format, using the local time zone. If set to 813 ``iso8601``, the local time is logged in ISO 8601 format. If set to 814 ``iso8601-utc``, the date and time are logged in ISO 8601 format, 815 with time zone set to UTC. The default is ``no``. 816 817 :any:`print-time` may be specified for a :any:`syslog` channel, but it is 818 usually pointless since :any:`syslog` also logs the date and time. 819 820 .. namedconf:statement:: print-category 821 :tags: logging 822 :short: Includes the category in log messages. 823 824 If :any:`print-category` is requested, then the category of the message 825 is logged as well. 826 827 .. namedconf:statement:: print-severity 828 :tags: logging 829 :short: Includes the severity in log messages. 830 831 If :any:`print-severity` is on, then the 832 severity level of the message is logged. The ``print-`` options may 833 be used in any combination, and are always printed in the following 834 order: time, category, severity. 835 836 Here is an example where all three ``print-`` options are on: 837 838 ``28-Feb-2000 15:05:32.863 general: notice: running`` 839 840 .. namedconf:statement:: buffered 841 :tags: logging 842 :short: Controls flushing of log messages. 843 844 If :any:`buffered` has been turned on, the output to files is not 845 flushed after each log entry. By default all log messages are flushed. 846 847 There are four predefined channels that are used for :iscman:`named`'s default 848 logging, as follows. If :iscman:`named` is started with the :option:`-L <named -L>` option, then a fifth 849 channel, ``default_logfile``, is added. How they are used is described in 850 :any:`category`. 851 852 :: 853 854 channel default_syslog { 855 // send to syslog's daemon facility 856 syslog daemon; 857 // only send priority info and higher 858 severity info; 859 }; 860 861 channel default_debug { 862 // write to named.run in the working directory 863 // Note: stderr is used instead of "named.run" if 864 // the server is started with the '-g' option. 865 file "named.run"; 866 // log at the server's current debug level 867 severity dynamic; 868 }; 869 870 channel default_stderr { 871 // writes to stderr 872 stderr; 873 // only send priority info and higher 874 severity info; 875 }; 876 877 channel null { 878 // toss anything sent to this channel 879 null; 880 }; 881 882 channel default_logfile { 883 // this channel is only present if named is 884 // started with the -L option, whose argument 885 // provides the file name 886 file "..."; 887 // log at the server's current debug level 888 severity dynamic; 889 }; 890 891 The ``default_debug`` channel has the special property that it only 892 produces output when the server's debug level is non-zero. It normally 893 writes to a file called ``named.run`` in the server's working directory. 894 895 For security reasons, when the :option:`-u <named -u>` command-line option is used, the 896 ``named.run`` file is created only after :iscman:`named` has changed to the 897 new UID, and any debug output generated while :iscman:`named` is starting - 898 and still running as root - is discarded. To capture this 899 output, run the server with the :option:`-L <named -L>` option to specify a 900 default logfile, or the :option:`-g <named -g>` option to log to standard error which can 901 be redirected to a file. 902 903 Once a channel is defined, it cannot be redefined. The 904 built-in channels cannot be altered directly, but the default logging 905 can be modified by pointing categories at defined channels. 906 907 The :any:`category` Phrase 908 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 909 There are many categories, so desired logs can be sent anywhere 910 while unwanted logs are ignored. If 911 a list of channels is not specified for a category, log messages in that 912 category are sent to the ``default`` category instead. If no 913 default category is specified, the following "default default" is used: 914 915 :: 916 917 category default { default_syslog; default_debug; }; 918 919 If :iscman:`named` is started with the :option:`-L <named -L>` option, the default category 920 is: 921 922 :: 923 924 category default { default_logfile; default_debug; }; 925 926 As an example, let's say a user wants to log security events to a file, but 927 also wants to keep the default logging behavior. They would specify the 928 following: 929 930 :: 931 932 channel my_security_channel { 933 file "my_security_file"; 934 severity info; 935 }; 936 category security { 937 my_security_channel; 938 default_syslog; 939 default_debug; 940 }; 941 942 943 To discard all messages in a category, specify the :namedconf:ref:`null` channel: 944 945 :: 946 947 category xfer-out { null; }; 948 category notify { null; }; 949 950 .. namedconf:statement:: category 951 :tags: logging 952 :short: Specifies the type of data logged to a particular channel. 953 954 The following are the available categories and brief descriptions of the 955 types of log information they contain. More categories may be added in 956 future BIND releases. 957 958 .. include:: logging-categories.inc.rst 959 960 .. _query_errors: 961 962 The ``query-errors`` Category 963 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 964 965 The ``query-errors`` category is used to indicate why and how specific queries 966 resulted in responses which indicate an error. Normally, these messages are 967 logged at ``debug`` logging levels; note, however, that if query logging is 968 active, some are logged at ``info``. The logging levels are described below: 969 970 At ``debug`` level 1 or higher - or at ``info`` when query logging is 971 active - each response with the rcode of SERVFAIL is logged as follows: 972 973 ``client 127.0.0.1#61502: query failed (SERVFAIL) for www.example.com/IN/AAAA at query.c:3880`` 974 975 This means an error resulting in SERVFAIL was detected at line 3880 of source 976 file ``query.c``. Log messages of this level are particularly helpful in identifying 977 the cause of SERVFAIL for an authoritative server. 978 979 At ``debug`` level 2 or higher, detailed context information about recursive 980 resolutions that resulted in SERVFAIL is logged. The log message looks 981 like this: 982 983 :: 984 985 fetch completed at resolver.c:2970 for www.example.com/A 986 in 10.000183: timed out/success [domain:example.com, 987 referral:2,restart:7,qrysent:8,timeout:5,lame:0,quota:0,neterr:0, 988 badresp:1,adberr:0,findfail:0,valfail:0] 989 990 The first part before the colon shows that a recursive resolution for 991 AAAA records of www.example.com completed in 10.000183 seconds, and the 992 final result that led to the SERVFAIL was determined at line 2970 of 993 source file ``resolver.c``. 994 995 The next part shows the detected final result and the latest result of 996 DNSSEC validation. The latter is always "success" when no validation attempt 997 was made. In this example, this query probably resulted in SERVFAIL because all 998 name servers are down or unreachable, leading to a timeout in 10 seconds. 999 DNSSEC validation was probably not attempted. 1000 1001 The last part, enclosed in square brackets, shows statistics collected for this 1002 particular resolution attempt. The ``domain`` field shows the deepest zone that 1003 the resolver reached; it is the zone where the error was finally detected. The 1004 meaning of the other fields is summarized in the following list. 1005 1006 ``referral`` 1007 The number of referrals the resolver received throughout the resolution process. In the above ``example.com`` there are two. 1008 1009 ``restart`` 1010 The number of cycles that the resolver tried remote servers at the ``domain`` zone. In each cycle, the resolver sends one query (possibly resending it, depending on the response) to each known name server of the ``domain`` zone. 1011 1012 ``qrysent`` 1013 The number of queries the resolver sent at the ``domain`` zone. 1014 1015 ``timeout`` 1016 The number of timeouts the resolver received since the last response. 1017 1018 ``lame`` 1019 The number of lame servers the resolver detected at the ``domain`` zone. A server is detected to be lame either by an invalid response or as a result of lookup in BIND 9's address database (ADB), where lame servers are cached. 1020 1021 ``quota`` 1022 The number of times the resolver was unable to send a query because it had exceeded the permissible fetch quota for a server. 1023 1024 ``neterr`` 1025 The number of erroneous results that the resolver encountered in sending queries at the ``domain`` zone. One common case is when the remote server is unreachable and the resolver receives an "ICMP unreachable" error message. 1026 1027 ``badresp`` 1028 The number of unexpected responses (other than ``lame``) to queries sent by the resolver at the ``domain`` zone. 1029 1030 ``adberr`` 1031 Failures in finding remote server addresses of the``domain`` zone in the ADB. One common case of this is that the remote server's name does not have any address records. 1032 1033 ``findfail`` 1034 Failures to resolve remote server addresses. This is a total number of failures throughout the resolution process. 1035 1036 ``valfail`` 1037 Failures of DNSSEC validation. Validation failures are counted throughout the resolution process (not limited to the ``domain`` zone), but should only happen in ``domain``. 1038 1039 At ``debug`` level 3 or higher, the same messages as those at 1040 ``debug`` level 1 are logged for errors other than 1041 SERVFAIL. Note that negative responses such as NXDOMAIN are not errors, and are 1042 not logged at this debug level. 1043 1044 At ``debug`` level 4 or higher, the detailed context information logged at 1045 ``debug`` level 2 is logged for errors other than SERVFAIL and for negative 1046 responses such as NXDOMAIN. 1047 1048 ``remote-servers`` Block Grammar 1049 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1050 .. namedconf:statement:: remote-servers 1051 :tags: server 1052 :short: Defines a list of servers to be used by primary and secondary zones. 1053 1054 This specifies a list that allows for a common set of servers to be easily used 1055 by multiple zones. The following options may reference to a list of 1056 remote servers: :any:`parental-agents`, :any:`primaries`, and :any:`also-notify`. 1057 1058 A "parental agent" is a trusted DNS server that is queried to check whether DS 1059 records for a given zones are up-to-date. 1060 1061 A "primary server" is where a secondary server can request zone transfers from. 1062 1063 To force the zone transfer requests to be sent over TLS, use :any:`tls` keyword, 1064 e.g. ``primaries { 192.0.2.1 tls tls-configuration-name; };``, 1065 where ``tls-configuration-name`` refers to a previously defined 1066 :any:`tls statement <tls>`. 1067 1068 .. warning:: 1069 1070 Please note that TLS connections to primaries are **not 1071 authenticated** unless :any:`remote-hostname` or :any:`ca-file` are specified 1072 within the :any:`tls statement <tls>` in use (see information on 1073 :ref:`Strict TLS <strict-tls>` and :ref:`Mutual TLS <mutual-tls>` 1074 for more details). **Not authenticated mode** (:ref:`Opportunistic 1075 TLS <opportunistic-tls>`) provides protection from passive 1076 observers but does not protect from man-in-the-middle attacks on 1077 zone transfers. 1078 1079 ``options`` Block Grammar 1080 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1081 .. namedconf:statement:: options 1082 :tags: server 1083 :short: Defines global options to be used by BIND 9. 1084 1085 This is the grammar of the ``options`` statement in the :iscman:`named.conf` 1086 file: 1087 1088 ``options`` Block Definition and Usage 1089 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1090 1091 The ``options`` statement sets up global options to be used by BIND. 1092 This statement may appear only once in a configuration file. If there is 1093 no ``options`` statement, an options block with each option set to its 1094 default is used. 1095 1096 .. namedconf:statement:: attach-cache 1097 :tags: view 1098 :short: Allows multiple views to share a single cache database. 1099 1100 This option allows multiple views to share a single cache database. Each view has 1101 its own cache database by default, but if multiple views have the 1102 same operational policy for name resolution and caching, those views 1103 can share a single cache to save memory, and possibly improve 1104 resolution efficiency, by using this option. 1105 1106 The :any:`attach-cache` option may also be specified in :any:`view` 1107 statements, in which case it overrides the global :any:`attach-cache` 1108 option. 1109 1110 The ``cache_name`` specifies the cache to be shared. When the :iscman:`named` 1111 server configures views which are supposed to share a cache, it 1112 creates a cache with the specified name for the first view of these 1113 sharing views. The rest of the views simply refer to the 1114 already-created cache. 1115 1116 One common configuration to share a cache is to allow all views 1117 to share a single cache. This can be done by specifying 1118 :any:`attach-cache` as a global option with an arbitrary name. 1119 1120 Another possible operation is to allow a subset of all views to share 1121 a cache while the others retain their own caches. For example, if 1122 there are three views A, B, and C, and only A and B should share a 1123 cache, specify the :any:`attach-cache` option as a view of A (or B)'s 1124 option, referring to the other view name: 1125 1126 :: 1127 1128 view "A" { 1129 // this view has its own cache 1130 ... 1131 }; 1132 view "B" { 1133 // this view refers to A's cache 1134 attach-cache "A"; 1135 }; 1136 view "C" { 1137 // this view has its own cache 1138 ... 1139 }; 1140 1141 Views that share a cache must have the same policy on configurable 1142 parameters that may affect caching. The current implementation 1143 requires the following configurable options be consistent among these 1144 views: :any:`check-names`, :any:`dnssec-accept-expired`, 1145 :any:`dnssec-validation`, :any:`max-cache-ttl`, :any:`max-ncache-ttl`, 1146 :any:`max-stale-ttl`, :any:`max-cache-size`, :any:`min-cache-ttl`, 1147 :any:`min-ncache-ttl`, and :any:`zero-no-soa-ttl`. 1148 1149 Note that there may be other parameters that may cause confusion if 1150 they are inconsistent for different views that share a single cache. 1151 For example, if these views define different sets of forwarders that 1152 can return different answers for the same question, sharing the 1153 answer does not make sense or could even be harmful. It is the 1154 administrator's responsibility to ensure that configuration differences in 1155 different views do not cause disruption with a shared cache. 1156 1157 .. namedconf:statement:: directory 1158 :tags: server 1159 :short: Sets the server's working directory. 1160 1161 This sets the working directory of the server. Any non-absolute pathnames in 1162 the configuration file are taken as relative to this directory. 1163 The default location for most server output files (e.g., 1164 ``named.run``) is this directory. If a directory is not specified, 1165 the working directory defaults to ``"."``, the directory from 1166 which the server was started. The directory specified should be an 1167 absolute path, and *must* be writable by the effective user ID of the 1168 :iscman:`named` process. 1169 1170 The option takes effect only at the time that the configuration 1171 option is parsed; if other files are being included before or after specifying the 1172 new :any:`directory`, the :any:`directory` option must be listed 1173 before any other directive (like ``include``) that can work with relative 1174 files. The safest way to include files is to use absolute file names. 1175 1176 .. namedconf:statement:: dnstap 1177 :tags: logging 1178 :short: Enables logging of :any:`dnstap` messages. 1179 1180 :any:`dnstap` is a fast, flexible method for capturing and logging DNS 1181 traffic. Developed by Robert Edmonds at Farsight Security, Inc., and 1182 supported by multiple DNS implementations, :any:`dnstap` uses 1183 ``libfstrm`` (a lightweight high-speed framing library; see 1184 https://github.com/farsightsec/fstrm) to send event payloads which 1185 are encoded using Protocol Buffers (``libprotobuf-c``, a mechanism 1186 for serializing structured data developed by Google, Inc.; see 1187 https://protobuf.dev). 1188 1189 To enable :any:`dnstap` at compile time, the ``fstrm`` and 1190 ``protobuf-c`` libraries must be available, and BIND must be 1191 configured with ``--enable-dnstap``. 1192 1193 The :any:`dnstap` option is a bracketed list of message types to be 1194 logged. These may be set differently for each view. Supported types 1195 are ``client``, ``auth``, ``resolver``, ``forwarder``, and 1196 ``update``. Specifying type ``all`` causes all :any:`dnstap` 1197 messages to be logged, regardless of type. 1198 1199 Each type may take an additional argument to indicate whether to log 1200 ``query`` messages or ``response`` messages; if not specified, both 1201 queries and responses are logged. 1202 1203 Example: To log all authoritative queries and responses, recursive 1204 client responses, and upstream queries sent by the resolver, use: 1205 1206 :: 1207 1208 dnstap { 1209 auth; 1210 client response; 1211 resolver query; 1212 }; 1213 1214 .. note:: In the default configuration, the dnstap output for 1215 recursive resolver traffic does not include the IP addresses used 1216 by server-side sockets. This is caused by the fact that unless the 1217 :ref:`query source address <query_address>` is explicitly set, 1218 these sockets are bound to wildcard IP addresses and determining 1219 the specific IP address used by each of them requires issuing a 1220 system call (i.e. incurring a performance penalty). 1221 1222 Logged :any:`dnstap` messages can be parsed using the :iscman:`dnstap-read` 1223 utility (see :ref:`man_dnstap-read` for details). 1224 1225 For more information on :any:`dnstap`, see https://dnstap.info. 1226 1227 The ``fstrm`` library has a number of tunables that are exposed in 1228 :iscman:`named.conf`, and can be modified if necessary to improve 1229 performance or prevent loss of data. These are: 1230 1231 .. namedconf:statement:: fstrm-set-buffer-hint 1232 :tags: logging 1233 :short: Sets the number of accumulated bytes in the output buffer before forcing a buffer flush. 1234 1235 The indicates the threshold number of bytes to 1236 accumulate in the output buffer before forcing a buffer flush. The 1237 minimum is 1024, the maximum is 65536, and the default is 8192. 1238 1239 .. namedconf:statement:: fstrm-set-flush-timeout 1240 :tags: logging 1241 :short: Sets the number of seconds that unflushed data remains in the output buffer. 1242 1243 This is the number of seconds to allow 1244 unflushed data to remain in the output buffer. The minimum is 1 1245 second, the maximum is 600 seconds (10 minutes), and the default 1246 is 1 second. 1247 1248 .. namedconf:statement:: fstrm-set-output-notify-threshold 1249 :tags: logging 1250 :short: Sets the number of outstanding queue entries allowed on an input queue before waking the I/O thread. 1251 1252 This indicates the number of outstanding 1253 queue entries to allow on an input queue before waking the I/O 1254 thread. The minimum is 1 and the default is 32. 1255 1256 .. namedconf:statement:: fstrm-set-output-queue-model 1257 :tags: logging 1258 :short: Sets the queuing semantics to use for queue objects. 1259 1260 This sets the queuing semantics 1261 to use for queue objects. The default is ``mpsc`` (multiple 1262 producer, single consumer); the other option is ``spsc`` (single 1263 producer, single consumer). 1264 1265 .. namedconf:statement:: fstrm-set-input-queue-size 1266 :tags: logging 1267 :short: Sets the number of queue entries to allocate for each input queue. 1268 1269 This is the number of queue entries to 1270 allocate for each input queue. This value must be a power of 2. 1271 The minimum is 2, the maximum is 16384, and the default is 512. 1272 1273 .. namedconf:statement:: fstrm-set-output-queue-size 1274 :tags: logging 1275 :short: Sets the number of queue entries allocated for each output queue. 1276 1277 This specifies the number of queue entries to 1278 allocate for each output queue. The minimum is 2, the maximum is 1279 system-dependent and based on ``IOV_MAX``, and the default is 64. 1280 1281 .. namedconf:statement:: fstrm-set-reopen-interval 1282 :tags: logging 1283 :short: Sets the number of seconds to wait between attempts to reopen a closed output stream. 1284 1285 This sets the number of seconds to wait 1286 between attempts to reopen a closed output stream. The minimum is 1287 1 second, the maximum is 600 seconds (10 minutes), and the default 1288 is 5 seconds. For convenience, TTL-style time-unit suffixes may be 1289 used to specify the value. 1290 1291 Note that all of the above minimum, maximum, and default values are 1292 set by the ``libfstrm`` library, and may be subject to change in 1293 future versions of the library. See the ``libfstrm`` documentation 1294 for more information. 1295 1296 .. namedconf:statement:: dnstap-output 1297 :tags: logging 1298 :short: Configures the path to which the :any:`dnstap` frame stream is sent. 1299 1300 This configures the path to which the :any:`dnstap` frame stream is sent 1301 if :any:`dnstap` is enabled at compile time and active. 1302 1303 The first argument is either ``file`` or ``unix``, indicating whether 1304 the destination is a file or a Unix domain socket. The second 1305 argument is the path of the file or socket. (Note: when using a 1306 socket, :any:`dnstap` messages are only sent if another process such 1307 as ``fstrm_capture`` (provided with ``libfstrm``) is listening on the 1308 socket.) 1309 1310 If the first argument is ``file``, then up to three additional 1311 options can be added: ``size`` indicates the size to which a 1312 :any:`dnstap` log file can grow before being rolled to a new file; 1313 ``versions`` specifies the number of rolled log files to retain; and 1314 ``suffix`` indicates whether to retain rolled log files with an 1315 incrementing counter as the suffix (``increment``) or with the 1316 current timestamp (``timestamp``). These are similar to the ``size``, 1317 ``versions``, and ``suffix`` options in a :any:`logging` channel. The 1318 default is to allow :any:`dnstap` log files to grow to any size without 1319 rolling. 1320 1321 :any:`dnstap-output` can only be set globally in :namedconf:ref:`options`. Currently, 1322 it can only be set once while :iscman:`named` is running; once set, it 1323 cannot be changed by :option:`rndc reload` or :option:`rndc reconfig`. 1324 1325 .. namedconf:statement:: dnstap-identity 1326 :tags: logging 1327 :short: Specifies an ``identity`` string to send in :any:`dnstap` messages. 1328 1329 This specifies an ``identity`` string to send in :any:`dnstap` messages. If 1330 set to :any:`hostname`, which is the default, the server's hostname 1331 is sent. If set to ``none``, no identity string is sent. 1332 1333 .. namedconf:statement:: dnstap-version 1334 :tags: logging 1335 :short: Specifies a :any:`version` string to send in :any:`dnstap` messages. 1336 1337 This specifies a :any:`version` string to send in :any:`dnstap` messages. The 1338 default is the version number of the BIND release. If set to 1339 ``none``, no version string is sent. 1340 1341 .. namedconf:statement:: geoip-directory 1342 :tags: server 1343 :short: Specifies the directory containing GeoIP database files. 1344 1345 When :iscman:`named` is compiled using the MaxMind GeoIP2 geolocation API, this 1346 specifies the directory containing GeoIP database files. By default, the 1347 option is set based on the prefix used to build the ``libmaxminddb`` module; 1348 for example, if the library is installed in ``/usr/local/lib``, then the 1349 default :any:`geoip-directory` is ``/usr/local/share/GeoIP``. See :any:`acl` 1350 for details about ``geoip`` ACLs. 1351 1352 .. namedconf:statement:: key-directory 1353 :tags: dnssec 1354 :short: Indicates the directory where public and private DNSSEC key files are found. 1355 1356 This is the directory where the public and private DNSSEC key files should be 1357 found when performing a dynamic update of secure zones, if different 1358 than the current working directory. (Note that this option has no 1359 effect on the paths for files containing non-DNSSEC keys, such as 1360 ``rndc.key``, or ``session.key``.) 1361 1362 .. namedconf:statement:: lmdb-mapsize 1363 :tags: server 1364 :short: Sets a maximum size for the memory map of the new-zone database in LMDB database format. 1365 1366 When :iscman:`named` is built with liblmdb, this option sets a maximum size 1367 for the memory map of the new-zone database (NZD) in LMDB database 1368 format. This database is used to store configuration information for 1369 zones added using :option:`rndc addzone`. Note that this is not the NZD 1370 database file size, but the largest size that the database may grow 1371 to. 1372 1373 Because the database file is memory-mapped, its size is limited by 1374 the address space of the :iscman:`named` process. The default of 32 megabytes 1375 was chosen to be usable with 32-bit :iscman:`named` builds. The largest 1376 permitted value is 1 terabyte. Given typical zone configurations 1377 without elaborate ACLs, a 32 MB NZD file ought to be able to hold 1378 configurations of about 100,000 zones. 1379 1380 .. namedconf:statement:: managed-keys-directory 1381 :tags: dnssec 1382 :short: Specifies the directory in which to store the files that track managed DNSSEC keys. 1383 1384 This specifies the directory in which to store the files that track managed DNSSEC 1385 keys (i.e., those configured using the ``initial-key`` or ``initial-ds`` 1386 keywords in a :any:`trust-anchors` statement). By default, this is the working 1387 directory. The directory *must* be writable by the effective user ID of the 1388 :iscman:`named` process. 1389 1390 If :iscman:`named` is not configured to use views, managed keys for 1391 the server are tracked in a single file called 1392 ``managed-keys.bind``. Otherwise, managed keys are tracked in 1393 separate files, one file per view; each file name is the view 1394 name (or, if it contains characters that are incompatible with use as 1395 a file name, the SHA256 hash of the view name), followed by the 1396 extension ``.mkeys``. 1397 1398 (Note: in earlier releases, file names for views always used the 1399 SHA256 hash of the view name. To ensure compatibility after upgrading, 1400 if a file using the old name format is found to exist, it is 1401 used instead of the new format.) 1402 1403 .. namedconf:statement:: max-ixfr-ratio 1404 :tags: transfer 1405 :short: Sets the maximum size for IXFR responses to zone transfer requests. 1406 1407 This sets the size threshold (expressed as a percentage of the size 1408 of the full zone) beyond which :iscman:`named` chooses to use an AXFR 1409 response rather than IXFR when answering zone transfer requests. See 1410 :ref:`incremental_zone_transfers`. 1411 1412 The minimum value is ``1%``. The keyword ``unlimited`` disables ratio 1413 checking and allows IXFRs of any size. The default is ``100%``. 1414 1415 .. namedconf:statement:: new-zones-directory 1416 :tags: zone 1417 :short: Specifies the directory where configuration parameters are stored for zones added by :option:`rndc addzone`. 1418 1419 This specifies the directory in which to store the configuration 1420 parameters for zones added via :option:`rndc addzone`. By default, this is 1421 the working directory. If set to a relative path, it is relative 1422 to the working directory. The directory *must* be writable by the 1423 effective user ID of the :iscman:`named` process. 1424 1425 .. namedconf:statement:: qname-minimization 1426 :tags: query 1427 :short: Controls QNAME minimization behavior in the BIND 9 resolver. 1428 1429 When this is set to ``strict``, BIND follows the QNAME minimization 1430 algorithm to the letter, as specified in :rfc:`7816`. 1431 1432 Setting this option to ``relaxed`` causes BIND to fall back to 1433 normal (non-minimized) query mode when it receives either NXDOMAIN 1434 or other unexpected responses (e.g., SERVFAIL, improper zone 1435 cut, REFUSED) to a minimized query. 1436 1437 In ``relaxed`` mode :iscman:`named` makes NS queries for ``<domain>`` as it 1438 walks down the tree. 1439 1440 ``disabled`` disables QNAME minimization completely. 1441 ``off`` is a synonym for ``disabled``. 1442 1443 The current default is ``relaxed``, but it may be changed to 1444 ``strict`` in a future release. 1445 1446 .. namedconf:statement:: tkey-gssapi-keytab 1447 :tags: security 1448 :short: Sets the KRB5 keytab file to use for GSS-TSIG updates. 1449 1450 This is the KRB5 keytab file to use for GSS-TSIG updates. If this option is 1451 set and ``tkey-gssapi-credential`` is not set, updates are 1452 allowed with any key matching a principal in the specified keytab. 1453 1454 .. namedconf:statement:: tkey-gssapi-credential 1455 :tags: security 1456 :short: Sets the security credential for authentication keys requested by the GSS-TSIG protocol. 1457 1458 This is the security credential with which the server should authenticate 1459 keys requested by the GSS-TSIG protocol. Currently only Kerberos 5 1460 authentication is available; the credential is a Kerberos 1461 principal which the server can acquire through the default system key 1462 file, normally ``/etc/krb5.keytab``. The location of the keytab file can be 1463 overridden using the :any:`tkey-gssapi-keytab` option. Normally this 1464 principal is of the form ``DNS/server.domain``. 1465 1466 .. namedconf:statement:: dump-file 1467 :tags: logging 1468 :short: Indicates the pathname of the file where the server dumps the database after :option:`rndc dumpdb`. 1469 1470 This is the pathname of the file the server dumps the database to, when 1471 instructed to do so with :option:`rndc dumpdb`. If not specified, the 1472 default is ``named_dump.db``. 1473 1474 .. namedconf:statement:: memstatistics-file 1475 :tags: logging 1476 :short: Sets the pathname of the file where the server writes memory usage statistics on exit. 1477 1478 This is the pathname of the file the server writes memory usage statistics to 1479 on exit. If not specified, the default is ``named.memstats``. 1480 1481 .. lock-file: 1482 :tags: obsolete 1483 :short: Sets the pathname of the file on which :iscman:`named` attempts to acquire a file lock when starting for the first time. 1484 1485 This option has been removed and using it will cause a fatal error. 1486 1487 .. namedconf:statement:: pid-file 1488 :tags: server 1489 :short: Specifies the pathname of the file where the server writes its process ID. 1490 1491 This is the pathname of the file the server writes its process ID in. If not 1492 specified, the default is |named_pid|. The PID file 1493 is used by programs that send signals to the running name 1494 server. Specifying ``pid-file none`` disables the use of a PID file; 1495 no file is written and any existing one is removed. Note 1496 that ``none`` is a keyword, not a filename, and therefore is not 1497 enclosed in double quotes. 1498 1499 .. namedconf:statement:: recursing-file 1500 :tags: server 1501 :short: Specifies the pathname of the file where the server dumps queries that are currently recursing via :option:`rndc recursing`. 1502 1503 This is the pathname of the file where the server dumps the queries that are 1504 currently recursing, when instructed to do so with :option:`rndc recursing`. 1505 If not specified, the default is ``named.recursing``. 1506 1507 .. namedconf:statement:: statistics-file 1508 :tags: logging, server 1509 :short: Specifies the pathname of the file where the server appends statistics, when using :option:`rndc stats`. 1510 1511 This is the pathname of the file the server appends statistics to, when 1512 instructed to do so using :option:`rndc stats`. If not specified, the 1513 default is ``named.stats`` in the server's current directory. The 1514 format of the file is described in :ref:`statsfile`. 1515 1516 .. namedconf:statement:: bindkeys-file 1517 :tags: dnssec 1518 :short: Specifies the pathname of a file to override the built-in trusted keys provided by :iscman:`named`. 1519 1520 This is the pathname of a file to override the built-in trusted keys provided 1521 by :iscman:`named`. See the discussion of :any:`dnssec-validation` for 1522 details. This is intended for server testing. 1523 1524 .. namedconf:statement:: secroots-file 1525 :tags: dnssec 1526 :short: Specifies the pathname of the file where the server dumps security roots, when using :option:`rndc secroots`. 1527 1528 This is the pathname of the file the server dumps security roots to, when 1529 instructed to do so with :option:`rndc secroots`. If not specified, the 1530 default is ``named.secroots``. 1531 1532 .. namedconf:statement:: session-keyfile 1533 :tags: security 1534 :short: Specifies the pathname of the file where a TSIG session key is written, when generated by :iscman:`named` for use by ``nsupdate -l``. 1535 1536 This is the pathname of the file into which to write a TSIG session key 1537 generated by :iscman:`named` for use by ``nsupdate -l``. If not specified, 1538 the default is |session_key|. (See :ref:`dynamic_update_policies`, 1539 and in particular the discussion of the :any:`update-policy` statement's 1540 ``local`` option, for more information about this feature.) 1541 1542 .. namedconf:statement:: session-keyname 1543 :tags: security 1544 :short: Specifies the key name for the TSIG session key. 1545 1546 This is the key name to use for the TSIG session key. If not specified, the 1547 default is ``local-ddns``. 1548 1549 .. namedconf:statement:: session-keyalg 1550 :tags: security 1551 :short: Specifies the algorithm to use for the TSIG session key. 1552 1553 This is the algorithm to use for the TSIG session key. Valid values are 1554 hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384, hmac-sha512, and 1555 hmac-md5. If not specified, the default is hmac-sha256. 1556 1557 .. namedconf:statement:: port 1558 :tags: server, query 1559 :short: Specifies the UDP/TCP port number the server uses to receive and send DNS protocol traffic. 1560 1561 This is the UDP/TCP port number the server uses to receive and send DNS 1562 protocol traffic. The default is 53. This option is mainly intended 1563 for server testing; a server using a port other than 53 is not 1564 able to communicate with the global DNS. 1565 1566 .. namedconf:statement:: tls-port 1567 :tags: server, query 1568 :short: Specifies the TCP port number the server uses to receive and send DNS-over-TLS protocol traffic. 1569 1570 This is the TCP port number the server uses to receive and send 1571 DNS-over-TLS protocol traffic. The default is 853. 1572 1573 .. namedconf:statement:: https-port 1574 :tags: server, query 1575 :short: Specifies the TCP port number the server uses to receive and send DNS-over-HTTPS protocol traffic. 1576 1577 This is the TCP port number the server uses to receive and send 1578 DNS-over-HTTPS protocol traffic. The default is 443. 1579 1580 .. namedconf:statement:: http-port 1581 :tags: server, query 1582 :short: Specifies the TCP port number the server uses to receive and send unencrypted DNS traffic via HTTP. 1583 1584 This is the TCP port number the server uses to receive and send 1585 unencrypted DNS traffic via HTTP (a configuration that may be useful 1586 when encryption is handled by third-party software or by a reverse 1587 proxy). 1588 1589 .. namedconf:statement:: http-listener-clients 1590 :tags: server 1591 :short: Limits the number of active concurrent connections on a per-listener basis. 1592 1593 This sets a hard limit on the number of active concurrent connections 1594 on a per-listener basis. The default value is 300; setting it to 0 1595 removes the quota. 1596 1597 .. namedconf:statement:: http-streams-per-connection 1598 :tags: server 1599 :short: Limits the number of active concurrent HTTP/2 streams on a per-connection basis. 1600 1601 This sets a hard limit on the number of active concurrent HTTP/2 1602 streams on a per-connection basis. The default value is 100; 1603 setting it to 0 removes the limit. Once the limit is exceeded, the 1604 server finishes the HTTP session. 1605 1606 .. namedconf:statement:: preferred-glue 1607 :tags: query 1608 :short: Controls the order of glue records in an A or AAAA response. 1609 1610 If specified, the listed type (A or AAAA) is emitted before 1611 other glue in the additional section of a query response. The default 1612 is to prefer A records when responding to queries that arrived via 1613 IPv4, and AAAA when responding to queries that arrived via IPv6. 1614 1615 .. namedconf:statement:: disable-algorithms 1616 :tags: dnssec 1617 :short: Disables DNSSEC algorithms from a specified zone. 1618 1619 This disables the specified DNSSEC algorithms at and below the specified 1620 zone. Multiple :any:`disable-algorithms` statements are allowed. Only 1621 the best-match :any:`disable-algorithms` clause is used to 1622 determine the algorithms. 1623 1624 If all supported algorithms are disabled, the zones covered by the 1625 :any:`disable-algorithms` setting are treated as insecure. 1626 1627 Configured trust anchors in :any:`trust-anchors` (or :any:`managed-keys` or 1628 :any:`trusted-keys`) that match a disabled algorithm are ignored and treated 1629 as if they were not configured. 1630 1631 .. namedconf:statement:: disable-ds-digests 1632 :tags: dnssec, zone 1633 :short: Disables DS digest types from a specified zone. 1634 1635 This disables the specified DS digest types at and below the specified 1636 name. Multiple :any:`disable-ds-digests` statements are allowed. Only 1637 the best-match :any:`disable-ds-digests` clause is used to 1638 determine the digest types. 1639 1640 If all supported digest types are disabled, the zones covered by 1641 :any:`disable-ds-digests` are treated as insecure. 1642 1643 .. namedconf:statement:: dnssec-must-be-secure 1644 :tags: deprecated 1645 :short: Defines hierarchies that must or may not be secure (signed and validated). 1646 1647 This option is deprecated and will be removed in a future release. 1648 1649 This specifies hierarchies which must be or may not be secure (signed and 1650 validated). If ``yes``, then :iscman:`named` only accepts answers if 1651 they are secure. If ``no``, then normal DNSSEC validation applies, 1652 allowing insecure answers to be accepted. The specified domain 1653 must be defined as a trust anchor, for instance in a :any:`trust-anchors` 1654 statement, or ``dnssec-validation auto`` must be active. 1655 1656 .. namedconf:statement:: dns64 1657 :tags: query 1658 :short: Instructs :iscman:`named` to return mapped IPv4 addresses to AAAA queries when there are no AAAA records. 1659 1660 This directive instructs :iscman:`named` to return mapped IPv4 addresses to 1661 AAAA queries when there are no AAAA records. It is intended to be 1662 used in conjunction with a NAT64. Each :any:`dns64` defines one DNS64 1663 prefix. Multiple DNS64 prefixes can be defined. 1664 1665 Compatible IPv6 prefixes have lengths of 32, 40, 48, 56, 64, and 96, per 1666 :rfc:`6052`. Bits 64..71 inclusive must be zero, with the most significant bit 1667 of the prefix in position 0. 1668 1669 In addition, a reverse IP6.ARPA zone is created for the prefix 1670 to provide a mapping from the IP6.ARPA names to the corresponding 1671 IN-ADDR.ARPA names using synthesized CNAMEs. 1672 1673 .. namedconf:statement:: dns64-server 1674 :tags: server 1675 :short: Specifies the name of the server for :any:`dns64` zones. 1676 1677 .. namedconf:statement:: dns64-contact 1678 :tags: server 1679 :short: Specifies the name of the contact for :any:`dns64` zones. 1680 1681 :any:`dns64-server` and 1682 :any:`dns64-contact` can be used to specify the name of the server and 1683 contact for the zones. These can be set at the view/options 1684 level but not on a per-prefix basis. 1685 1686 :any:`dns64` will also cause IPV4ONLY.ARPA to be created if not 1687 explicitly disabled using :any:`ipv4only-enable`. 1688 1689 .. namedconf:statement:: clients 1690 :tags: query 1691 :short: Specifies an access control list (ACL) of clients that are affected by a given :any:`dns64` directive. 1692 1693 Each :any:`dns64` supports an optional :any:`clients` ACL that determines 1694 which clients are affected by this directive. If not defined, it 1695 defaults to ``any;``. 1696 1697 .. namedconf:statement:: mapped 1698 :tags: query 1699 :short: Specifies an access control list (ACL) of IPv4 addresses that are to be mapped to the corresponding A RRset in :any:`dns64`. 1700 1701 Each :any:`dns64` block supports an optional :any:`mapped` ACL that selects which 1702 IPv4 addresses are to be mapped in the corresponding A RRset. If not 1703 defined, it defaults to ``any;``. 1704 1705 .. namedconf:statement:: exclude 1706 :tags: query 1707 :short: Allows a list of IPv6 addresses to be ignored if they appear in a domain name's AAAA records in :any:`dns64`. 1708 1709 Normally, DNS64 does not apply to a domain name that owns one or more 1710 AAAA records; these records are simply returned. The optional 1711 :any:`exclude` ACL allows specification of a list of IPv6 addresses that 1712 are ignored if they appear in a domain name's AAAA records; 1713 DNS64 is applied to any A records the domain name owns. If not 1714 defined, :any:`exclude` defaults to ::ffff:0.0.0.0/96. 1715 1716 .. namedconf:statement:: suffix 1717 :tags: query 1718 :short: Defines trailing bits for mapped IPv4 address bits in :any:`dns64`. 1719 1720 An optional :any:`suffix` can also be defined to set the bits trailing 1721 the mapped IPv4 address bits. By default these bits are set to 1722 ``::``. The bits matching the prefix and mapped IPv4 address must be 1723 zero. 1724 1725 .. namedconf:statement:: recursive-only 1726 :tags: query 1727 :short: Toggles whether :any:`dns64` synthesis occurs only for recursive queries. 1728 1729 If :any:`recursive-only` is set to ``yes``, the DNS64 synthesis only 1730 happens for recursive queries. The default is ``no``. 1731 1732 .. namedconf:statement:: break-dnssec 1733 :tags: query 1734 :short: Enables :any:`dns64` synthesis even if the validated result would cause a DNSSEC validation failure. 1735 1736 If :any:`break-dnssec` is set to ``yes``, the DNS64 synthesis happens 1737 even if the result, if validated, would cause a DNSSEC validation 1738 failure. If this option is set to ``no`` (the default), the DO is set 1739 on the incoming query, and there are RRSIGs on the applicable 1740 records, then synthesis does not happen. 1741 1742 :: 1743 1744 acl rfc1918 { 10/8; 192.168/16; 172.16/12; }; 1745 1746 dns64 64:FF9B::/96 { 1747 clients { any; }; 1748 mapped { !rfc1918; any; }; 1749 exclude { 64:FF9B::/96; ::ffff:0000:0000/96; }; 1750 suffix ::; 1751 }; 1752 1753 .. namedconf:statement:: resolver-use-dns64 1754 :tags: server 1755 :short: Specifies whether to apply DNS64 mappings when sending queries. 1756 1757 If :any:`resolver-use-dns64` is set to ``yes``, then the IPv4-to-IPv6 1758 address transformations specified by the :any:`dns64` option are 1759 applied to IPv4 server addresses to which recursive queries are sent. 1760 This allows a server to perform lookups via a NAT64 connection; queries 1761 that would have been sent via IPv4 are instead sent to mapped IPv6 1762 addresses. The default is ``no``. 1763 1764 .. namedconf:statement:: ipv4only-enable 1765 :tags: query 1766 :short: Enables automatic IPv4 zones if a :any:`dns64` block is configured. 1767 1768 This enables or disables automatic zones ``ipv4only.arpa``, 1769 ``170.0.0.192.in-addr.arpa``, and ``171.0.0.192.in-addr.arpa``. 1770 1771 By default these zones are loaded if :any:`dns64` is configured. 1772 1773 .. namedconf:statement:: ipv4only-server 1774 :tags: server, query 1775 :short: Specifies the name of the server for the IPV4ONLY.ARPA zone created by :any:`dns64`. 1776 1777 .. namedconf:statement:: ipv4only-contact 1778 :tags: server 1779 :short: Specifies the contact for the IPV4ONLY.ARPA zone created by :any:`dns64`. 1780 1781 :any:`ipv4only-server` and :any:`ipv4only-contact` can be used to specify the name 1782 of the server and contact for the IPV4ONLY.ARPA zone created by 1783 :any:`dns64`. 1784 1785 .. namedconf:statement:: dnssec-loadkeys-interval 1786 :tags: dnssec 1787 :short: Sets the frequency of automatic checks of the DNSSEC key repository. 1788 1789 When a zone is configured with ``dnssec-policy;``, its key 1790 repository must be checked periodically to see whether the next step of a key 1791 rollover is due. The :any:`dnssec-loadkeys-interval` option 1792 sets the default interval of key repository checks, in minutes, in case 1793 the next key event cannot be calculated (e.g. because a DS record 1794 needs to be published). 1795 1796 The default is ``60`` (1 hour), the minimum is ``1`` (1 minute), and 1797 the maximum is ``1440`` (24 hours); any higher value is silently 1798 reduced. 1799 1800 :namedconf:ref:`dnssec-policy` 1801 1802 This specifies which key and signing policy (KASP) should be used for this 1803 zone. This is a string referring to a :namedconf:ref:`dnssec-policy` block. 1804 The default is ``none``. 1805 1806 .. namedconf:statement:: dnssec-update-mode 1807 :tags: obsolete 1808 1809 This option no longer has any effect. 1810 1811 .. namedconf:statement:: nta-lifetime 1812 :tags: dnssec 1813 :short: Specifies the lifetime, in seconds, for negative trust anchors added via :option:`rndc nta`. 1814 1815 This specifies the default lifetime, in seconds, for 1816 negative trust anchors added via :option:`rndc nta`. 1817 1818 A negative trust anchor selectively disables DNSSEC validation for 1819 zones that are known to be failing because of misconfiguration, rather 1820 than an attack. When data to be validated is at or below an active 1821 NTA (and above any other configured trust anchors), :iscman:`named` 1822 aborts the DNSSEC validation process and treats the data as insecure 1823 rather than bogus. This continues until the NTA's lifetime has 1824 elapsed. NTAs persist across :iscman:`named` restarts. 1825 1826 For convenience, TTL-style time-unit suffixes can be used to specify the NTA 1827 lifetime in seconds, minutes, or hours. It also accepts ISO 8601 duration 1828 formats. 1829 1830 :any:`nta-lifetime` defaults to one hour; it cannot exceed one week. 1831 1832 .. namedconf:statement:: nta-recheck 1833 :tags: dnssec 1834 :short: Specifies the time interval for checking whether negative trust anchors added via :option:`rndc nta` are still necessary. 1835 1836 This specifies how often to check whether negative trust anchors added via 1837 :option:`rndc nta` are still necessary. 1838 1839 A negative trust anchor is normally used when a domain has stopped 1840 validating due to operator error; it temporarily disables DNSSEC 1841 validation for that domain. In the interest of ensuring that DNSSEC 1842 validation is turned back on as soon as possible, :iscman:`named` 1843 periodically sends a query to the domain, ignoring negative trust 1844 anchors, to find out whether it can now be validated. If so, the 1845 negative trust anchor is allowed to expire early. 1846 1847 Validity checks can be disabled for an individual NTA by using 1848 :option:`rndc nta -f <rndc nta>`, or for all NTAs by setting :any:`nta-recheck` to zero. 1849 1850 For convenience, TTL-style time-unit suffixes can be used to specify the NTA 1851 recheck interval in seconds, minutes, or hours. It also accepts ISO 8601 1852 duration formats. 1853 1854 The default is five minutes. It cannot be longer than :any:`nta-lifetime`, which 1855 cannot be longer than a week. 1856 1857 .. namedconf:statement:: max-zone-ttl 1858 :tags: deprecated 1859 :short: Specifies a maximum permissible time-to-live (TTL) value, in seconds. 1860 1861 This should now be configured as part of :namedconf:ref:`dnssec-policy`. 1862 Use of this option in :namedconf:ref:`options`, :namedconf:ref:`view`, 1863 and :namedconf:ref:`zone` blocks is a fatal error if 1864 :namedconf:ref:`dnssec-policy` has also been configured for the same 1865 zone. In zones without :namedconf:ref:`dnssec-policy`, this option is 1866 deprecated, and will be rendered non-operational in a future release. 1867 1868 :any:`max-zone-ttl` specifies a maximum permissible TTL value in seconds. 1869 For convenience, TTL-style time-unit suffixes may be used to specify the 1870 maximum value. When a zone file is loaded, any record encountered with a 1871 TTL higher than :any:`max-zone-ttl` causes the zone to be rejected. 1872 1873 This is needed in DNSSEC-maintained zones because when rolling to a new 1874 DNSKEY, the old key needs to remain available until RRSIG records 1875 have expired from caches. The :any:`max-zone-ttl` option guarantees that 1876 the largest TTL in the zone is no higher than the set value. 1877 1878 When used in :namedconf:ref:`options`, :namedconf:ref:`view` and 1879 :namedconf:ref:`zone` blocks, setting :any:`max-zone-ttl` to zero 1880 is equivalent to "unlimited". 1881 1882 .. namedconf:statement:: stale-answer-ttl 1883 :tags: query 1884 :short: Specifies the time to live (TTL) to be returned on stale answers, in seconds. 1885 1886 This specifies the TTL to be returned on stale answers. The default is 30 1887 seconds. The minimum allowed is 1 second; a value of 0 is updated silently 1888 to 1 second. 1889 1890 For stale answers to be returned, they must be enabled, either in the 1891 configuration file using :any:`stale-answer-enable` or via 1892 :option:`rndc serve-stale on <rndc serve-stale>`. 1893 1894 .. namedconf:statement:: serial-update-method 1895 :tags: zone 1896 :short: Specifies the update method to be used for the zone serial number in the SOA record. 1897 1898 Zones configured for dynamic DNS may use this option to set the 1899 update method to be used for the zone serial number in the SOA 1900 record. 1901 1902 With the default setting of ``serial-update-method increment;``, the 1903 SOA serial number is incremented by one each time the zone is 1904 updated. 1905 1906 When set to ``serial-update-method unixtime;``, the SOA serial number 1907 is set to the number of seconds since the Unix epoch, unless the 1908 serial number is already greater than or equal to that value, in 1909 which case it is simply incremented by one. 1910 1911 When set to ``serial-update-method date;``, the new SOA serial number 1912 is the current date in the form "YYYYMMDD", followed by two 1913 zeroes, unless the existing serial number is already greater than or 1914 equal to that value, in which case it is incremented by one. 1915 1916 .. namedconf:statement:: zone-statistics 1917 :tags: zone, logging 1918 :short: Controls the level of statistics gathered for all zones. 1919 1920 If ``full``, the server collects statistical data on all zones, 1921 unless specifically turned off on a per-zone basis by specifying 1922 ``zone-statistics terse`` or ``zone-statistics none`` in the :any:`zone` 1923 statement. The statistical data includes, for example, DNSSEC signing 1924 operations and the number of authoritative answers per query type. The 1925 default is ``terse``, providing minimal statistics on zones 1926 (including name and current serial number, but not query type 1927 counters), and also information about the currently ongoing incoming zone 1928 transfers. 1929 1930 These statistics may be accessed via the ``statistics-channel`` or 1931 using :option:`rndc stats`, which dumps them to the file listed in the 1932 :any:`statistics-file`. See also :ref:`statsfile`. 1933 1934 For backward compatibility with earlier versions of BIND 9, the 1935 :any:`zone-statistics` option can also accept ``yes`` or ``no``; ``yes`` 1936 has the same meaning as ``full``. As of BIND 9.10, ``no`` has the 1937 same meaning as ``none``; previously, it was the same as ``terse``. 1938 1939 .. _boolean_options: 1940 1941 Boolean Options 1942 ^^^^^^^^^^^^^^^ 1943 1944 .. namedconf:statement:: automatic-interface-scan 1945 :tags: server 1946 :short: Controls the automatic rescanning of network interfaces when addresses are added or removed. 1947 1948 If ``yes`` and supported by the operating system, this automatically rescans 1949 network interfaces when the interface addresses are added or removed. The 1950 default is ``yes``. This configuration option does not affect the time-based 1951 :any:`interface-interval` option; it is recommended to set the time-based 1952 :any:`interface-interval` to 0 when the operator confirms that automatic 1953 interface scanning is supported by the operating system. 1954 1955 The :any:`automatic-interface-scan` implementation uses routing sockets for the 1956 network interface discovery; therefore, the operating system must 1957 support the routing sockets for this feature to work. 1958 1959 .. namedconf:statement:: allow-new-zones 1960 :tags: server, zone 1961 :short: Controls the ability to add zones at runtime via :option:`rndc addzone`. 1962 1963 If ``yes``, then zones can be added at runtime via :option:`rndc addzone`. 1964 The default is ``no``. 1965 1966 Newly added zones' configuration parameters are stored so that they 1967 can persist after the server is restarted. The configuration 1968 information is saved in a file called ``viewname.nzf`` (or, if 1969 :iscman:`named` is compiled with liblmdb, in an LMDB database file called 1970 ``viewname.nzd``). "viewname" is the name of the view, unless the view 1971 name contains characters that are incompatible with use as a file 1972 name, in which case a cryptographic hash of the view name is used 1973 instead. 1974 1975 Configurations for zones added at runtime are stored either in 1976 a new-zone file (NZF) or a new-zone database (NZD), depending on 1977 whether :iscman:`named` was linked with liblmdb at compile time. See 1978 :ref:`man_rndc` for further details about :option:`rndc addzone`. 1979 1980 .. namedconf:statement:: auth-nxdomain 1981 :tags: query 1982 :short: Controls whether BIND, acting as a resolver, provides authoritative NXDOMAIN (domain does not exist) answers. 1983 1984 If ``yes``, then the ``AA`` bit is always set on NXDOMAIN responses, 1985 even if the server is not actually authoritative. The default is 1986 ``no``. 1987 1988 .. namedconf:statement:: memstatistics 1989 :tags: server, logging 1990 :short: Controls whether memory statistics are written to the file specified by :any:`memstatistics-file` at exit. 1991 1992 This writes memory statistics to the file specified by 1993 :any:`memstatistics-file` at exit. The default is ``no`` unless :option:`-m 1994 record <named -m>` is specified on the command line, in which case it is ``yes``. 1995 1996 .. namedconf:statement:: dialup 1997 :tags: deprecated 1998 :short: Concentrates zone maintenance so that all transfers take place once every :any:`heartbeat-interval`, ideally during a single call. 1999 2000 This option is deprecated and will be removed in a future release. 2001 2002 If ``yes``, then the server treats all zones as if they are doing 2003 zone transfers across a dial-on-demand dialup link, which can be 2004 brought up by traffic originating from this server. Although this setting has 2005 different effects according to zone type, it concentrates the zone 2006 maintenance so that everything happens quickly, once every 2007 :any:`heartbeat-interval`, ideally during a single call. It also 2008 suppresses some normal zone maintenance traffic. The default 2009 is ``no``. 2010 2011 If specified in the :any:`view` and 2012 :any:`zone` statements, the :any:`dialup` option overrides the global :any:`dialup` 2013 option. 2014 2015 If the zone is a primary zone, the server sends out a NOTIFY 2016 request to all the secondaries (default). This should trigger the zone 2017 serial number check in the secondary (providing it supports NOTIFY), 2018 allowing the secondary to verify the zone while the connection is active. 2019 The set of servers to which NOTIFY is sent can be controlled by 2020 :namedconf:ref:`notify` and :any:`also-notify`. 2021 2022 If the zone is a secondary or stub zone, the server suppresses 2023 the regular "zone up to date" (refresh) queries and only performs them 2024 when the :any:`heartbeat-interval` expires, in addition to sending NOTIFY 2025 requests. 2026 2027 Finer control can be achieved by using :namedconf:ref:`notify`, which only sends 2028 NOTIFY messages; ``notify-passive``, which sends NOTIFY messages and 2029 suppresses the normal refresh queries; ``refresh``, which suppresses 2030 normal refresh processing and sends refresh queries when the 2031 :any:`heartbeat-interval` expires; and ``passive``, which disables 2032 normal refresh processing. 2033 2034 +--------------------+-----------------+-----------------+-----------------+ 2035 | dialup mode | normal refresh | heart-beat | heart-beat | 2036 | | | refresh | notify | 2037 +--------------------+-----------------+-----------------+-----------------+ 2038 | ``no`` | yes | no | no | 2039 | (default) | | | | 2040 +--------------------+-----------------+-----------------+-----------------+ 2041 | ``yes`` | no | yes | yes | 2042 +--------------------+-----------------+-----------------+-----------------+ 2043 | ``notify`` | yes | no | yes | 2044 +--------------------+-----------------+-----------------+-----------------+ 2045 | ``refresh`` | no | yes | no | 2046 +--------------------+-----------------+-----------------+-----------------+ 2047 | ``passive`` | no | no | no | 2048 +--------------------+-----------------+-----------------+-----------------+ 2049 | ``notify-passive`` | no | no | yes | 2050 +--------------------+-----------------+-----------------+-----------------+ 2051 2052 Note that normal NOTIFY processing is not affected by :any:`dialup`. 2053 2054 .. namedconf:statement:: flush-zones-on-shutdown 2055 :tags: zone 2056 :short: Controls whether pending zone writes are flushed when the name server exits. 2057 2058 When the name server exits upon receiving SIGTERM, flush or do not 2059 flush any pending zone writes. The default is 2060 ``flush-zones-on-shutdown no``. 2061 2062 .. namedconf:statement:: root-key-sentinel 2063 :tags: server 2064 :short: Controls whether BIND 9 responds to root key sentinel probes. 2065 2066 If ``yes``, the server responds to root key sentinel probes as described in 2067 :rfc:`8509`:. The default is ``yes``. 2068 2069 .. namedconf:statement:: reuseport 2070 :tags: server 2071 :short: Enables kernel load-balancing of sockets. 2072 2073 This option enables kernel load-balancing of sockets on systems which support 2074 it, including Linux (SO_REUSEPORT) and FreeBSD (SO_REUSEPORT_LB). This 2075 instructs the kernel to distribute incoming socket connections among the 2076 networking threads based on a hashing scheme. For more information, see the 2077 receive network flow classification options (``rx-flow-hash``) section in the 2078 ``ethtool`` manual page. The default is ``yes``. 2079 2080 Enabling :any:`reuseport` significantly increases general throughput when 2081 incoming traffic is distributed uniformly onto the threads by the 2082 operating system. However, in cases where a worker thread is busy with a 2083 long-lasting operation, such as processing a Response Policy Zone (RPZ) or 2084 Catalog Zone update or an unusually large zone transfer, incoming traffic 2085 that hashes onto that thread may be delayed. On servers where these events 2086 occur frequently, it may be preferable to disable socket load-balancing so 2087 that other threads can pick up the traffic that would have been sent to the 2088 busy thread. 2089 2090 Note: this option can only be set when :iscman:`named` first starts. 2091 Changes will not take effect during reconfiguration; the server 2092 must be restarted. 2093 2094 .. namedconf:statement:: message-compression 2095 :tags: query 2096 :short: Controls whether DNS name compression is used in responses to regular queries. 2097 2098 If ``yes``, DNS name compression is used in responses to regular 2099 queries (not including AXFR or IXFR, which always use compression). 2100 Setting this option to ``no`` reduces CPU usage on servers and may 2101 improve throughput. However, it increases response size, which may 2102 cause more queries to be processed using TCP; a server with 2103 compression disabled is out of compliance with :rfc:`1123` Section 2104 6.1.3.2. The default is ``yes``. 2105 2106 .. namedconf:statement:: minimal-responses 2107 :tags: query 2108 :short: Controls whether the server only adds records to the authority and additional data sections when they are required (e.g. delegations, negative responses). This improves server performance. 2109 2110 This option controls the addition of records to the authority and 2111 additional sections of responses. Such records may be included in 2112 responses to be helpful to clients; for example, MX records may 2113 have associated address records included in the additional section, 2114 obviating the need for a separate address lookup. However, adding 2115 these records to responses is not mandatory and requires additional 2116 database lookups, causing extra latency when marshalling responses. 2117 2118 Responses to DNSKEY, DS, CDNSKEY, and CDS requests will never have 2119 optional additional records added. Responses to NS requests will 2120 always have additional section processing. 2121 2122 :any:`minimal-responses` takes one of four values: 2123 2124 - ``no``: the server is as complete as possible when generating 2125 responses. 2126 - ``yes``: the server only adds records to the authority and additional 2127 sections when such records are required by the DNS protocol (for 2128 example, when returning delegations or negative responses). This 2129 provides the best server performance but may result in more client 2130 queries. 2131 - ``no-auth``: the server omits records from the authority section except 2132 when they are required, but it may still add records to the 2133 additional section. 2134 - ``no-auth-recursive``: the same as ``no-auth`` when recursion is requested 2135 in the query (RD=1), or the same as ``no`` if recursion is not requested. 2136 2137 ``no-auth`` and ``no-auth-recursive`` are useful when answering stub 2138 clients, which usually ignore the authority section. 2139 ``no-auth-recursive`` is meant for use in mixed-mode servers that 2140 handle both authoritative and recursive queries. 2141 2142 The default is ``no-auth-recursive``. 2143 2144 .. namedconf:statement:: minimal-any 2145 :tags: query 2146 :short: Controls whether the server replies with only one of the RRsets for a query name, when generating a positive response to a query of type ANY over UDP. 2147 2148 If set to ``yes``, the server replies with only one of 2149 the RRsets for the query name, and its covering RRSIGs if any, 2150 when generating a positive response to a query of type ANY over UDP, 2151 instead of replying with all known RRsets for the name. Similarly, a 2152 query for type RRSIG is answered with the RRSIG records covering 2153 only one type. This can reduce the impact of some kinds of attack 2154 traffic, without harming legitimate clients. (Note, however, that the 2155 RRset returned is the first one found in the database; it is not 2156 necessarily the smallest available RRset.) Additionally, 2157 :any:`minimal-responses` is turned on for these queries, so no 2158 unnecessary records are added to the authority or additional 2159 sections. The default is ``no``. 2160 2161 .. namedconf:statement:: notify 2162 :tags: transfer 2163 :short: Controls whether ``NOTIFY`` messages are sent on zone changes. 2164 2165 If set to ``yes`` (the default), DNS NOTIFY messages are sent when a 2166 zone the server is authoritative for changes; see :ref:`using notify<notify>`. 2167 The messages are sent to the servers listed in the zone's NS records 2168 (except the primary server identified in the SOA MNAME field), and to 2169 any servers listed in the :any:`also-notify` option. 2170 2171 If set to ``primary-only`` (or the older keyword ``master-only``), 2172 notifies are only sent for primary zones. If set to ``explicit``, 2173 notifies are sent only to servers explicitly listed using 2174 :any:`also-notify`. If set to ``no``, no notifies are sent. 2175 2176 The :namedconf:ref:`notify` option may also be specified in the :any:`zone` 2177 statement, in which case it overrides the ``options notify`` 2178 statement. It would only be necessary to turn off this option if it 2179 caused secondary zones to crash. 2180 2181 .. namedconf:statement:: notify-to-soa 2182 :tags: transfer 2183 :short: Controls whether the name servers in the NS RRset are checked against the SOA MNAME. 2184 2185 If ``yes``, do not check the name servers in the NS RRset against the 2186 SOA MNAME. Normally a NOTIFY message is not sent to the SOA MNAME 2187 (SOA ORIGIN), as it is supposed to contain the name of the ultimate 2188 primary server. Sometimes, however, a secondary server is listed as the SOA MNAME in 2189 hidden primary configurations; in that case, the 2190 ultimate primary should be set to still send NOTIFY messages to all the name servers 2191 listed in the NS RRset. 2192 2193 .. namedconf:statement:: recursion 2194 :tags: query 2195 :short: Defines whether recursion and caching are allowed. 2196 2197 If ``yes``, and a DNS query requests recursion, then the server 2198 attempts to do all the work required to answer the query. If recursion 2199 is off and the server does not already know the answer, it 2200 returns a referral response. The default is ``yes``. Note that setting 2201 ``recursion no`` does not prevent clients from getting data from the 2202 server's cache; it only prevents new data from being cached as an 2203 effect of client queries. Caching may still occur as an effect of the 2204 server's internal operation, such as NOTIFY address lookups. 2205 2206 .. namedconf:statement:: request-nsid 2207 :tags: query 2208 :short: Controls whether an empty EDNS(0) NSID (Name Server Identifier) option is sent with all queries to authoritative name servers during iterative resolution. 2209 2210 If ``yes``, then an empty EDNS(0) NSID (Name Server Identifier) 2211 option is sent with all queries to authoritative name servers during 2212 iterative resolution. If the authoritative server returns an NSID 2213 option in its response, then its contents are logged in the ``nsid`` 2214 category at level ``info``. The default is ``no``. 2215 2216 .. namedconf:statement:: require-cookie 2217 :tags: query 2218 :short: Controls whether responses without a server cookie are accepted. 2219 2220 The ``require-cookie`` clause can be used to indicate that the 2221 remote server is known to support DNS COOKIE. Setting this option 2222 to ``yes`` causes :iscman:`named` to always retry a request over TCP when 2223 it receives a UDP response without a DNS COOKIE from the remote 2224 server, even if UDP responses with DNS COOKIE have not been sent 2225 by this server before. This prevents spoofed answers from being 2226 accepted without a retry over TCP, when :iscman:`named` has not yet 2227 determined whether the remote server supports DNS COOKIE. Setting 2228 this option to ``no`` (the default) causes :iscman:`named` to rely on 2229 autodetection of DNS COOKIE support to determine when to retry a 2230 request over TCP. 2231 2232 For DNAME lookups the default is ``yes`` and it is enforced. Servers 2233 serving DNAME must correctly support DNS over TCP. 2234 2235 .. note:: 2236 If a UDP response is signed using TSIG, :iscman:`named` accepts it even if 2237 ``require-cookie`` is set to ``yes`` and the response does not 2238 contain a DNS COOKIE. 2239 2240 The ``send-cookie`` clause determines whether the local server adds 2241 a COOKIE EDNS option to requests sent to the server. This overrides 2242 ``send-cookie`` set at the view or option level. The :iscman:`named` server 2243 may determine that COOKIE is not supported by the remote server and not 2244 add a COOKIE EDNS option to requests. 2245 2246 .. namedconf:statement:: require-server-cookie 2247 :tags: query 2248 :short: Controls whether a valid server cookie is required before sending a full response to a UDP request. 2249 2250 If ``yes``, BIND requires a valid server cookie before sending a full response to a UDP 2251 request from a cookie-aware client. BADCOOKIE is sent if there is a 2252 bad or nonexistent server cookie. 2253 2254 The default is ``no``. 2255 2256 Users wishing to test that DNS COOKIE clients correctly handle 2257 BADCOOKIE, or who are getting a lot of forged DNS requests with DNS COOKIES 2258 present, should set this to ``yes``. Setting this to ``yes`` results in a reduced amplification effect 2259 in a reflection attack, as the BADCOOKIE response is smaller than a full 2260 response, while also requiring a legitimate client to follow up with a second 2261 query with the new, valid, cookie. 2262 2263 .. namedconf:statement:: answer-cookie 2264 :tags: query 2265 :short: Controls whether COOKIE EDNS replies are sent in response to client queries. 2266 2267 When set to the default value of ``yes``, COOKIE EDNS options are 2268 sent when applicable in replies to client queries. If set to ``no``, 2269 COOKIE EDNS options are not sent in replies. This can only be set 2270 at the global options level, not per-view. 2271 2272 ``answer-cookie no`` is intended as a temporary measure, for use when 2273 :iscman:`named` shares an IP address with other servers that do not yet 2274 support DNS COOKIE. A mismatch between servers on the same address is 2275 not expected to cause operational problems, but the option to disable 2276 COOKIE responses so that all servers have the same behavior is 2277 provided out of an abundance of caution. DNS COOKIE is an important 2278 security mechanism, and should not be disabled unless absolutely 2279 necessary. 2280 2281 .. namedconf:statement:: send-cookie 2282 :tags: query 2283 :short: Controls whether a COOKIE EDNS option is sent along with a query. 2284 2285 If ``yes``, a COOKIE EDNS option is sent along with the query. 2286 If the resolver has previously communicated with the server, the COOKIE 2287 returned in the previous transaction is sent. This is used by the 2288 server to determine whether the resolver has talked to it before. A 2289 resolver sending the correct COOKIE is assumed not to be an off-path 2290 attacker sending a spoofed-source query; the query is therefore 2291 unlikely to be part of a reflection/amplification attack, so 2292 resolvers sending a correct COOKIE option are not subject to response-rate 2293 limiting (RRL). Resolvers which do not send a correct COOKIE 2294 option may be limited to receiving smaller responses via the 2295 :any:`nocookie-udp-size` option. 2296 2297 The :iscman:`named` server may determine that COOKIE is not supported by the 2298 remote server and not add a COOKIE EDNS option to requests. 2299 2300 The default is ``yes``. 2301 2302 .. namedconf:statement:: stale-answer-enable 2303 :tags: server, query 2304 :short: Enables the returning of "stale" cached answers when the name servers for a zone are not answering. 2305 2306 If ``yes``, this option enables the returning of "stale" cached answers when the name 2307 servers for a zone are not answering and the :any:`stale-cache-enable` option is 2308 also enabled. The default is not to return stale answers. 2309 2310 Stale answers can also be enabled or disabled at runtime via 2311 :option:`rndc serve-stale on <rndc serve-stale>` or :option:`rndc serve-stale off <rndc serve-stale>`; these override 2312 the configured setting. :option:`rndc serve-stale reset <rndc serve-stale>` restores the 2313 setting to the one specified in :iscman:`named.conf`. Note that if stale 2314 answers have been disabled by :iscman:`rndc`, they cannot be 2315 re-enabled by reloading or reconfiguring :iscman:`named`; they must be 2316 re-enabled with :option:`rndc serve-stale on <rndc serve-stale>`, or the server must be 2317 restarted. 2318 2319 Information about stale answers is logged under the ``serve-stale`` 2320 log category. 2321 2322 .. namedconf:statement:: stale-answer-client-timeout 2323 :tags: server, query 2324 :short: Defines the amount of time (in milliseconds) that :iscman:`named` waits before attempting to answer a query with a stale RRset from cache. 2325 2326 This option defines the amount of time (in milliseconds) that :iscman:`named` 2327 waits before attempting to answer the query with a stale RRset from cache. 2328 If a stale answer is found, :iscman:`named` continues the ongoing fetches, 2329 attempting to refresh the RRset in cache until the 2330 :any:`resolver-query-timeout` interval is reached. 2331 2332 This option is off by default, which is equivalent to setting it to 2333 ``off`` or ``disabled``. It also has no effect if :any:`stale-answer-enable` 2334 is disabled. 2335 2336 The minimum value, ``0``, causes a cached (stale) RRset to be 2337 immediately returned if it is available, while still attempting to 2338 refresh the data in cache. 2339 2340 When this option is enabled, the only supported value in the current version 2341 of BIND 9 is ``0``. Non-zero values generate a warning message and are 2342 treated as ``0``. 2343 2344 .. namedconf:statement:: stale-cache-enable 2345 :tags: server, query 2346 :short: Enables the retention of "stale" cached answers. 2347 2348 If ``yes``, enable the retaining of "stale" cached answers. Default ``no``. 2349 2350 .. namedconf:statement:: stale-refresh-time 2351 :tags: server, query 2352 :short: Sets the time window for the return of "stale" cached answers before the next attempt to contact, if the name servers for a given zone are not responding. 2353 2354 If the name servers for a given zone are not answering, this sets the time 2355 window for which :iscman:`named` will promptly return "stale" cached answers for 2356 that RRSet being requested before a new attempt in contacting the servers 2357 is made. For convenience, TTL-style time-unit suffixes may be used to 2358 specify the value. It also accepts ISO 8601 duration formats. 2359 2360 The default :any:`stale-refresh-time` is 30 seconds, as :rfc:`8767` recommends 2361 that attempts to refresh to be done no more frequently than every 30 2362 seconds. A value of zero disables the feature, meaning that normal 2363 resolution will take place first, if that fails only then :iscman:`named` will 2364 return "stale" cached answers. 2365 2366 .. namedconf:statement:: nocookie-udp-size 2367 :tags: query 2368 :short: Sets the maximum size of UDP responses that are sent to queries without a valid server COOKIE. 2369 2370 This sets the maximum size of UDP responses that are sent to queries 2371 without a valid server COOKIE. A value below 128 is silently 2372 raised to 128. The default value is 4096, but the :any:`max-udp-size` 2373 option may further limit the response size as the default for 2374 :any:`max-udp-size` is 1232. 2375 2376 .. namedconf:statement:: cookie-algorithm 2377 :tags: server 2378 :short: Sets the algorithm to be used when generating a server cookie. 2379 2380 This sets the algorithm to be used when generating the server cookie. The 2381 default is "siphash24", which is the only supported option, as the 2382 previously supported "aes" option has been removed. 2383 2384 .. namedconf:statement:: cookie-secret 2385 :tags: server 2386 :short: Specifies a shared secret used for generating and verifying EDNS COOKIE options within an anycast cluster. 2387 2388 If set, this is a shared secret used for generating and verifying 2389 EDNS COOKIE options within an anycast cluster. If not set, the system 2390 generates a random secret at startup. The shared secret is 2391 encoded as a hex string and needs to be 128 bits. 2392 2393 If there are multiple secrets specified, the first one listed in 2394 :iscman:`named.conf` is used to generate new server cookies. The others 2395 are only used to verify returned cookies. 2396 2397 .. namedconf:statement:: response-padding 2398 :tags: query 2399 :short: Adds an EDNS Padding option to encrypted messages, to reduce the chance of guessing the contents based on size. 2400 2401 The EDNS Padding option is intended to improve confidentiality when 2402 DNS queries are sent over an encrypted channel, by reducing the 2403 variability in packet sizes. If a query: 2404 2405 1. contains an EDNS Padding option, 2406 2. includes a valid server cookie or uses TCP, 2407 3. is not signed using TSIG or SIG(0), and 2408 4. is from a client whose address matches the specified ACL, 2409 2410 then the response is padded with an EDNS Padding option to a multiple 2411 of ``block-size`` bytes. If these conditions are not met, the 2412 response is not padded. 2413 2414 If ``block-size`` is 0 or the ACL is ``none;``, this feature is 2415 disabled and no padding occurs; this is the default. If 2416 ``block-size`` is greater than 512, a warning is logged and the value 2417 is truncated to 512. Block sizes are ordinarily expected to be powers 2418 of two (for instance, 128), but this is not mandatory. 2419 2420 .. namedconf:statement:: trust-anchor-telemetry 2421 :tags: dnssec 2422 :short: Instructs :iscman:`named` to send specially formed queries once per day to domains for which trust anchors have been configured. 2423 2424 This causes :iscman:`named` to send specially formed queries once per day to 2425 domains for which trust anchors have been configured via, e.g., 2426 :any:`trust-anchors` or ``dnssec-validation auto``. 2427 2428 The query name used for these queries has the form 2429 ``_ta-xxxx(-xxxx)(...).<domain>``, where each "xxxx" is a group of four 2430 hexadecimal digits representing the key ID of a trusted DNSSEC key. 2431 The key IDs for each domain are sorted smallest to largest prior to 2432 encoding. The query type is NULL. 2433 2434 By monitoring these queries, zone operators are able to see which 2435 resolvers have been updated to trust a new key; this may help them 2436 decide when it is safe to remove an old one. 2437 2438 The default is ``yes``. 2439 2440 .. namedconf:statement:: provide-ixfr 2441 :tags: transfer 2442 :short: Controls whether a primary responds to an incremental zone request (IXFR) or only responds with a full zone transfer (AXFR). 2443 2444 The :any:`provide-ixfr` clause determines whether the local server, acting 2445 as primary, responds with an incremental zone transfer when the given 2446 remote server, a secondary, requests it. If set to ``yes``, incremental 2447 transfer is provided whenever possible. If set to ``no``, all 2448 transfers to the remote server are non-incremental. 2449 2450 .. namedconf:statement:: request-ixfr 2451 :tags: transfer 2452 :short: Controls whether a secondary requests an incremental zone transfer (IXFR) or a full zone transfer (AXFR). 2453 2454 The :any:`request-ixfr` statement determines whether the local server, acting 2455 as a secondary, requests incremental zone transfers from the given 2456 remote server, a primary. 2457 2458 IXFR requests to servers that do not support IXFR automatically 2459 fall back to AXFR. Therefore, there is no need to manually list which 2460 servers support IXFR and which ones do not; the global default of 2461 ``yes`` should always work. The purpose of the :any:`provide-ixfr` and 2462 :any:`request-ixfr` statements is to make it possible to disable the use of 2463 IXFR even when both primary and secondary claim to support it: for example, if 2464 one of the servers is buggy and crashes or corrupts data when IXFR is 2465 used. 2466 2467 It may also be set in the zone block; if set there, it overrides the global 2468 or view setting for that zone. It may also be set in the 2469 :namedconf:ref:`server` block. 2470 2471 .. namedconf:statement:: request-expire 2472 :tags: transfer, query 2473 :short: Specifies whether the local server requests the EDNS EXPIRE value, when acting as a secondary. 2474 2475 The :any:`request-expire` statement determines whether the local server, when 2476 acting as a secondary, requests the EDNS EXPIRE value. The EDNS EXPIRE 2477 value indicates the remaining time before the zone data expires and 2478 needs to be refreshed. This is used when a secondary server transfers 2479 a zone from another secondary server; when transferring from the 2480 primary, the expiration timer is set from the EXPIRE field of the SOA 2481 record instead. The default is ``yes``. 2482 2483 .. namedconf:statement:: match-mapped-addresses 2484 :tags: server 2485 :short: Allows IPv4-mapped IPv6 addresses to match address-match list entries for corresponding IPv4 addresses. 2486 2487 If ``yes``, then an IPv4-mapped IPv6 address matches any 2488 address-match list entries that match the corresponding IPv4 address. 2489 2490 This option was introduced to work around a kernel quirk in some 2491 operating systems that causes IPv4 TCP connections, such as zone 2492 transfers, to be accepted on an IPv6 socket using mapped addresses. 2493 This caused address-match lists designed for IPv4 to fail to match. 2494 However, :iscman:`named` now solves this problem internally. The use of 2495 this option is discouraged. 2496 2497 .. namedconf:statement:: ixfr-from-differences 2498 :tags: transfer 2499 :short: Controls how IXFR transfers are calculated. 2500 2501 When ``yes`` and the server loads a new version of a primary zone from 2502 its zone file or receives a new version of a secondary file via zone 2503 transfer, it compares the new version to the previous one and 2504 calculates a set of differences. The differences are then logged in 2505 the zone's journal file so that the changes can be transmitted to 2506 downstream secondaries as an incremental zone transfer. 2507 2508 By allowing incremental zone transfers to be used for non-dynamic 2509 zones, this option saves bandwidth at the expense of increased CPU 2510 and memory consumption at the primary server. In particular, if the new 2511 version of a zone is completely different from the previous one, the 2512 set of differences is of a size comparable to the combined size 2513 of the old and new zone versions, and the server needs to 2514 temporarily allocate memory to hold this complete difference set. 2515 2516 :any:`ixfr-from-differences` also accepts ``primary`` 2517 and ``secondary`` at the view and options levels, 2518 which causes :any:`ixfr-from-differences` to be enabled for all primary 2519 or secondary zones, respectively. It is off for all zones by default. 2520 2521 Note: if inline signing is enabled for a zone, the user-provided 2522 :any:`ixfr-from-differences` setting is ignored for that zone. 2523 2524 .. namedconf:statement:: multi-master 2525 :tags: transfer 2526 :short: Controls whether serial number mismatch errors are logged. 2527 2528 This should be set when there are multiple primary servers for a zone and the 2529 addresses refer to different machines. If ``yes``, :iscman:`named` does not 2530 log when the serial number on the primary is less than what :iscman:`named` 2531 currently has. The default is ``no``. 2532 2533 .. namedconf:statement:: dnssec-validation 2534 :tags: dnssec 2535 :short: Enables DNSSEC validation in :iscman:`named`. 2536 2537 This option enables DNSSEC validation in :iscman:`named`. 2538 2539 If set to ``auto``, DNSSEC validation is enabled and a default trust 2540 anchor for the DNS root zone is used. This trust anchor is provided 2541 as part of BIND and is kept up-to-date using :ref:`rfc5011.support` key 2542 management. Adding an explicit static key using the :any:`trust-anchors` 2543 statement, with a ``static-key`` anchor type (or using the deprecated 2544 :any:`trusted-keys` statement) for the root zone, is not supported with the 2545 ``auto`` setting and is treated as a configuration error. 2546 2547 If set to ``yes``, DNSSEC validation is enabled, but a trust anchor must be 2548 manually configured using a :any:`trust-anchors` statement (or the 2549 :any:`managed-keys` or :any:`trusted-keys` statements, both deprecated). If 2550 :any:`trust-anchors` is not configured, it is a configuration error. If 2551 :any:`trust-anchors` does not include a valid root key, then validation does 2552 not take place for names which are not covered by any of the configured trust 2553 anchors. 2554 2555 If set to ``no``, DNSSEC validation is disabled. (Note: the resolver 2556 will still set the DO bit in outgoing queries to indicate that it can 2557 accept DNSSEC responses, even if :any:`dnssec-validation` is disabled.) 2558 2559 The default is ``auto``, unless BIND is built with 2560 ``configure --disable-auto-validation``, in which case the default is 2561 ``yes``. 2562 2563 The default root trust anchor is compiled into :iscman:`named` 2564 and is current as of the release date. If the root key changes, a 2565 running BIND server detects this and rolls smoothly to the new 2566 key. However, newly installed servers will be unable to start validation, 2567 and BIND must be upgraded to a newer version. 2568 2569 .. namedconf:statement:: validate-except 2570 :tags: dnssec 2571 :short: Specifies a list of domain names at and beneath which DNSSEC validation should not be performed. 2572 2573 This specifies a list of domain names at and beneath which DNSSEC 2574 validation should *not* be performed, regardless of the presence of a 2575 trust anchor at or above those names. This may be used, for example, 2576 when configuring a top-level domain intended only for local use, so 2577 that the lack of a secure delegation for that domain in the root zone 2578 does not cause validation failures. (This is similar to setting a 2579 negative trust anchor except that it is a permanent configuration, 2580 whereas negative trust anchors expire and are removed after a set 2581 period of time.) 2582 2583 .. namedconf:statement:: dnssec-accept-expired 2584 :tags: dnssec 2585 :short: Instructs BIND 9 to accept expired DNSSEC signatures when validating. 2586 2587 This accepts expired signatures when verifying DNSSEC signatures. The 2588 default is ``no``. Setting this option to ``yes`` leaves :iscman:`named` 2589 vulnerable to replay attacks. 2590 2591 .. namedconf:statement:: querylog 2592 :tags: logging, server 2593 :short: Specifies whether query logging should be active when :iscman:`named` first starts. 2594 2595 Query logging provides a complete log of all incoming queries and all query 2596 errors. This provides more insight into the server's activity, but with a 2597 cost to performance which may be significant on heavily loaded servers. 2598 2599 The :any:`querylog` option specifies whether query logging should be active when 2600 :iscman:`named` first starts. If :any:`querylog` is not specified, then query logging 2601 is determined by the presence of the logging category ``queries``. Please 2602 note that :option:`rndc reconfig` and :option:`rndc reload` have no effect on 2603 this option, so it cannot be changed once the server is running. However, 2604 query logging can be activated at runtime using the command ``rndc querylog 2605 on``, or deactivated with :option:`rndc querylog off <rndc querylog>`. 2606 2607 .. namedconf:statement:: responselog 2608 :tags: logging, server 2609 :short: Specifies whether response logging should be active when :iscman:`named` first starts. 2610 2611 Response logging complements :any:`querylog` by logging the rcode of 2612 previous queries along with the queries' name, type and class. 2613 2614 Response logging can also be activated at runtime using the 2615 command ``rndc responselog on``, or deactivated with :option:`rndc 2616 responselog off <rndc responselog>`. 2617 2618 .. namedconf:statement:: check-names 2619 :tags: query, server 2620 :short: Restricts the character set and syntax of certain domain names in primary files and/or DNS responses received from the network. 2621 2622 This option is used to restrict the character set and syntax of 2623 certain domain names in primary files and/or DNS responses received 2624 from the network. The default varies according to usage area. For 2625 :any:`type primary` zones the default is ``fail``. For :any:`type secondary` zones the 2626 default is ``warn``. For answers received from the network 2627 (``response``), the default is ``ignore``. 2628 2629 The rules for legal hostnames and mail domains are derived from 2630 :rfc:`952` and :rfc:`821` as modified by :rfc:`1123`. 2631 2632 :any:`check-names` applies to the owner names of A, AAAA, and MX records. 2633 It also applies to the domain names in the RDATA of NS, SOA, MX, and 2634 SRV records. It further applies to the RDATA of PTR records where the 2635 owner name indicates that it is a reverse lookup of a hostname (the 2636 owner name ends in IN-ADDR.ARPA, IP6.ARPA, or IP6.INT). 2637 2638 .. namedconf:statement:: check-dup-records 2639 :tags: dnssec, query 2640 :short: Checks primary zones for records that are treated as different by DNSSEC but are semantically equal in plain DNS. 2641 2642 This checks primary zones for records that are treated as different by 2643 DNSSEC but are semantically equal in plain DNS. The default is to 2644 ``warn``. Other possible values are ``fail`` and ``ignore``. 2645 2646 .. namedconf:statement:: check-mx 2647 :tags: zone 2648 :short: Checks whether an MX record appears to refer to an IP address. 2649 2650 This checks whether the MX record appears to refer to an IP address. The 2651 default is to ``warn``. Other possible values are ``fail`` and 2652 ``ignore``. 2653 2654 .. namedconf:statement:: check-wildcard 2655 :tags: zone 2656 :short: Checks for non-terminal wildcards. 2657 2658 This option is used to check for non-terminal wildcards. The use of 2659 non-terminal wildcards is almost always as a result of a lack of 2660 understanding of the wildcard-matching algorithm (:rfc:`1034`). This option 2661 affects primary zones. The default (``yes``) is to check for 2662 non-terminal wildcards and issue a warning. 2663 2664 .. namedconf:statement:: check-integrity 2665 :tags: zone 2666 :short: Performs post-load zone integrity checks on primary zones. 2667 2668 This performs post-load zone integrity checks on primary zones. It checks 2669 that MX and SRV records refer to address (A or AAAA) records and that 2670 glue address records exist for delegated zones. For MX and SRV 2671 records, only in-zone hostnames are checked (for out-of-zone hostnames, 2672 use :iscman:`named-checkzone`). For NS records, only names below top-of-zone 2673 are checked (for out-of-zone names and glue consistency checks, use 2674 :iscman:`named-checkzone`). DS records not at delegations are rejected. 2675 The default is ``yes``. 2676 2677 The use of the SPF record to publish Sender Policy Framework is 2678 deprecated, as the migration from using TXT records to SPF records was 2679 abandoned. Enabling this option also checks that a TXT Sender Policy 2680 Framework record exists (starts with "v=spf1") if there is an SPF 2681 record. Warnings are emitted if the TXT record does not exist; they can 2682 be suppressed with :any:`check-spf`. 2683 2684 .. namedconf:statement:: check-mx-cname 2685 :tags: zone 2686 :short: Sets the response to MX records that refer to CNAMEs. 2687 2688 If :any:`check-integrity` is set, :iscman:`named` fails, warns, or ignores MX records 2689 that refer to CNAMEs. The default is to ``warn``. 2690 2691 .. namedconf:statement:: check-srv-cname 2692 :tags: zone 2693 :short: Sets the response to SRV records that refer to CNAMEs. 2694 2695 If :any:`check-integrity` is set, :iscman:`named` fails, warns, or ignores SRV records 2696 that refer to CNAMEs. The default is to ``warn``. 2697 2698 .. namedconf:statement:: check-sibling 2699 :tags: zone 2700 :short: Specifies whether to check for sibling glue when performing integrity checks. 2701 2702 This option instructs BIND to also check that sibling glue exists, 2703 when performing integrity checks. The default is ``yes``. 2704 2705 .. namedconf:statement:: check-spf 2706 :tags: zone 2707 :short: Specifies whether to check for a TXT Sender Policy Framework record, if an SPF record is present. 2708 2709 If :any:`check-integrity` is set, :iscman:`named` checks whether there is a TXT Sender 2710 Policy Framework record present (starts with "v=spf1"), if there is an 2711 SPF record present. The default is ``warn``. 2712 2713 .. namedconf:statement:: check-svcb 2714 :tags: zone 2715 :short: Specifies whether to perform additional checks on SVCB records. 2716 2717 If ``yes``, :iscman:`named` checks that SVCB records that start with a ``_dns`` 2718 label prefixed by an optional ``_<port>`` label (e.g. 2719 ``_443._dns.ns1.example``) have an ``alpn`` parameter, and that 2720 the ``dohpath`` parameter exists when the ``alpn`` indicates 2721 that it should be present. The default is ``yes``. 2722 2723 .. namedconf:statement:: zero-no-soa-ttl 2724 :tags: zone, query, server 2725 :short: Specifies whether to set the time to live (TTL) of the SOA record to zero, when returning authoritative negative responses to SOA queries. 2726 2727 If ``yes``, when returning authoritative negative responses to SOA queries, :iscman:`named` sets 2728 the TTL of the SOA record returned in the authority section to zero. 2729 The default is ``yes``. 2730 2731 .. namedconf:statement:: zero-no-soa-ttl-cache 2732 :tags: zone, query, server 2733 :short: Sets the time to live (TTL) to zero when caching a negative response to an SOA query. 2734 2735 If ``yes``, this option instructs BIND to set the TTL to zero when caching a negative response to an SOA query. 2736 The default is ``no``. 2737 2738 .. namedconf:statement:: update-check-ksk 2739 :tags: obsolete 2740 2741 This option no longer has any effect. 2742 2743 .. namedconf:statement:: dnssec-dnskey-kskonly 2744 :tags: obsolete 2745 2746 This option no longer has any effect. 2747 2748 .. namedconf:statement:: try-tcp-refresh 2749 :tags: transfer 2750 :short: Specifies that BIND 9 should attempt to refresh a zone using TCP if UDP queries fail. 2751 2752 If ``yes``, BIND tries to refresh the zone using TCP if UDP queries fail. The default is 2753 ``yes``. 2754 2755 .. namedconf:statement:: dnssec-secure-to-insecure 2756 :tags: obsolete 2757 2758 This option no longer has any effect. 2759 2760 .. namedconf:statement:: synth-from-dnssec 2761 :tags: dnssec 2762 :short: Enables support for :rfc:`8198`, Aggressive Use of DNSSEC-Validated Cache. 2763 2764 This option enables support for :rfc:`8198`, Aggressive Use of 2765 DNSSEC-Validated Cache. It allows the resolver to send a smaller number 2766 of queries when resolving queries for DNSSEC-signed domains 2767 by synthesizing answers from cached NSEC and other RRsets that 2768 have been proved to be correct using DNSSEC. 2769 The default is ``yes``. 2770 2771 .. note:: DNSSEC validation must be enabled for this option to be effective. 2772 This initial implementation only covers synthesis of answers from 2773 NSEC records; synthesis from NSEC3 is planned for the future. This 2774 will also be controlled by :any:`synth-from-dnssec`. 2775 2776 Forwarding 2777 ^^^^^^^^^^ 2778 2779 The forwarding facility sends queries which cannot be answered using local data 2780 to different resolvers. This can be used to create a large site-wide cache on 2781 a few servers, reducing traffic over links to external name servers. It 2782 can also be used to allow queries by servers that do not have direct 2783 access to the Internet, but that wish to look up exterior names anyway. 2784 Forwarding occurs only on those queries for which the server is not 2785 authoritative and does not have the answer in its cache. 2786 2787 .. namedconf:statement:: forward 2788 :tags: query 2789 :short: Allows or disallows fallback to recursion if forwarding has failed; it is always used in conjunction with the :any:`forwarders` statement. 2790 2791 This option is only meaningful if the :any:`forwarders` list is not empty. A 2792 value of ``first`` is the default and causes the server to query the 2793 forwarders first; if that does not answer the question, the 2794 server then looks for the answer itself. If ``only`` is 2795 specified, the server only queries the forwarders. 2796 2797 .. namedconf:statement:: forwarders 2798 :tags: query 2799 :short: Defines one or more resolvers to which queries are forwarded. 2800 2801 This specifies a list of IP addresses of DNS resolvers, to which queries 2802 which cannot be answered using locally available data are forwarded. The 2803 default is the empty list (no forwarding). Each address in the list can be 2804 associated with an optional port number and a TLS transport. A default port 2805 number and a TLS transport can be set for the entire list. 2806 2807 If a TLS configuration is specified, :iscman:`named` uses DNS-over-TLS 2808 (DoT) connections when connecting to the specified IP address(es), via the 2809 TLS configuration referenced by the :any:`tls` statement. 2810 2811 Forwarding can also be configured on a per-domain basis, allowing for 2812 the global forwarding options to be overridden in a variety of ways. 2813 Particular domains can be set to use different forwarders, or have a 2814 different ``forward only/first`` behavior, or not forward at all; see 2815 :any:`zone`. 2816 2817 .. _dual_stack: 2818 2819 Dual-stack Servers 2820 ^^^^^^^^^^^^^^^^^^ 2821 2822 Dual-stack servers are used as servers of last resort, to work around 2823 problems in reachability due to the lack of support for either IPv4 or IPv6 2824 on the host machine. 2825 2826 .. namedconf:statement:: dual-stack-servers 2827 :tags: server 2828 :short: Specifies host names or addresses of machines with access to both IPv4 and IPv6 transports. 2829 2830 This specifies host names or addresses of machines with access to both 2831 IPv4 and IPv6 transports. If a hostname is used, the server must be 2832 able to resolve the name using only the transport it has. If the 2833 machine is dual-stacked, the :any:`dual-stack-servers` parameter has no 2834 effect unless access to a transport has been disabled on the command 2835 line (e.g., :option:`named -4`). 2836 2837 .. _access_control: 2838 2839 Access Control 2840 ^^^^^^^^^^^^^^ 2841 2842 Access to the server can be restricted based on the IP address of the 2843 requesting system. See :ref:`address_match_lists` 2844 for details on how to specify IP address lists. 2845 2846 .. namedconf:statement:: allow-notify 2847 :tags: transfer 2848 :short: Defines an :any:`address_match_list` that is allowed to send ``NOTIFY`` messages for the zone, in addition to addresses defined in the :any:`primaries` option for the zone. 2849 2850 This ACL specifies which hosts may send NOTIFY messages to inform 2851 this server of changes to zones for which it is acting as a secondary 2852 server. This is only applicable for secondary zones (i.e., :any:`type 2853 secondary` or ``slave``). 2854 2855 If this option is set in :any:`view` or :namedconf:ref:`options`, it is globally 2856 applied to all secondary zones. If set in the :any:`zone` statement, the 2857 global value is overridden. 2858 2859 If not specified, the default is to process NOTIFY messages only from 2860 the configured :any:`primaries` for the zone. :any:`allow-notify` can be used 2861 to expand the list of permitted hosts, not to reduce it. 2862 2863 .. namedconf:statement:: allow-proxy 2864 :tags: server 2865 :short: Defines an :any:`address_match_list` for the client addresses allowed to send PROXYv2 headers. 2866 2867 The default :any:`address_match_list` is `none`, which means that 2868 no client is allowed to do that by default for security reasons, as 2869 the PROXYv2 protocol provides an easy way to spoof both source and 2870 destination addresses. 2871 2872 This :any:`address_match_list` is primarily meant to have addresses 2873 and subnets of the proxies that are allowed to send PROXYv2 headers 2874 to BIND. In most cases, we do not recommend setting this 2875 :any:`address_match_list` to be very permissive; in particular, we recommend against 2876 setting it to `any`, especially in cases when PROXYv2 headers can be 2877 accepted on publicly available networking interfaces. 2878 2879 The specified option is the only option that matches against real 2880 peer addresses when PROXYv2 headers are used. Most of the options 2881 that work with peer addresses use the ones extracted from PROXYv2 2882 headers. 2883 2884 See also: :namedconf:ref:`allow-proxy-on`. 2885 2886 .. namedconf:statement:: allow-proxy-on 2887 :tags: server 2888 :short: Defines an :any:`address_match_list` for the interface addresses allowed to accept PROXYv2 headers. The option is mostly intended for multi-homed configurations. 2889 2890 The default :any:`address_match_list` is `any`, which means that 2891 accepting PROXYv2 is allowed on any interface. 2892 2893 The option is useful in cases when a user needs to have precise control 2894 over which interfaces allow PROXYv2, as it is the only option 2895 that matches against real interface addresses when PROXYv2 headers 2896 are used. Most options that work with interface addresses 2897 use the ones extracted from PROXYv2 headers. 2898 2899 It may be desirable to first set :namedconf:ref:`allow-proxy`. 2900 2901 .. namedconf:statement:: allow-query 2902 :tags: query 2903 :short: Specifies which hosts (an IP address list) are allowed to send queries to this resolver. 2904 2905 :any:`allow-query` may also be specified in the :any:`zone` statement, in 2906 which case it overrides the ``options allow-query`` statement. If not 2907 specified, the default is to allow queries from all hosts. 2908 2909 .. note:: :any:`allow-query-cache` is used to specify access to the cache. 2910 2911 .. namedconf:statement:: allow-query-on 2912 :tags: query 2913 :short: Specifies which local addresses (an IP address list) are allowed to send queries to this resolver. This option is used in multi-homed configurations. 2914 2915 This makes it possible, for instance, to allow queries on 2916 internal-facing interfaces but disallow them on external-facing ones, 2917 without necessarily knowing the internal network's addresses. 2918 2919 Note that :any:`allow-query-on` is only checked for queries that are 2920 permitted by :any:`allow-query`. A query must be allowed by both ACLs, 2921 or it is refused. 2922 2923 :any:`allow-query-on` may also be specified in the :any:`zone` statement, 2924 in which case it overrides the ``options allow-query-on`` statement. 2925 2926 If not specified, the default is to allow queries on all addresses. 2927 2928 .. note:: :any:`allow-query-cache` is used to specify access to the cache. 2929 2930 .. namedconf:statement:: allow-query-cache 2931 :tags: query 2932 :short: Specifies which hosts (an IP address list) can access this server's cache and thus effectively controls recursion. 2933 2934 This option defines an :term:`address_match_list` of IP address(es) which are allowed to 2935 issue queries that access the local cache. Without access to the local 2936 cache, recursive queries are effectively useless so, in effect, this 2937 statement (or its default) controls recursive behavior. This statement's 2938 default setting depends on: 2939 2940 1. If :namedconf:ref:`recursion no; <recursion>` present, it defaults to 2941 ``allow-query-cache {none;};``. No local cache access permitted. 2942 2943 2. If :namedconf:ref:`recursion yes; <recursion>` (default), then, if 2944 :any:`allow-recursion` is present, it defaults to the value of 2945 :any:`allow-recursion`. Local cache access is permitted to the same 2946 :term:`address_match_list` as :any:`allow-recursion`. 2947 2948 3. If :namedconf:ref:`recursion yes; <recursion>` (default), then, if 2949 :any:`allow-recursion` is **not** present, it defaults to 2950 ``allow-query-cache {localnets; localhost;};``. Local cache access is permitted 2951 to :term:`address_match_list` localnets and localhost IP addresses only. 2952 2953 .. namedconf:statement:: allow-query-cache-on 2954 :tags: query 2955 :short: Specifies which hosts (from an IP address list) can access this server's cache. It is used on servers with multiple interfaces. 2956 2957 This specifies which local addresses can send answers from the cache. If 2958 :any:`allow-query-cache-on` is not set, then :any:`allow-recursion-on` is 2959 used if set. Otherwise, the default is to allow cache responses to be 2960 sent from any address. Note: both :any:`allow-query-cache` and 2961 :any:`allow-query-cache-on` must be satisfied before a cache response 2962 can be sent; a client that is blocked by one cannot be allowed by the 2963 other. 2964 2965 .. namedconf:statement:: allow-recursion 2966 :tags: query 2967 :short: Defines an :any:`address_match_list` of clients that are allowed to perform recursive queries. 2968 2969 This specifies which hosts are allowed to make recursive queries through 2970 this server. BIND checks to see if the following parameters are set, in 2971 order: :any:`allow-query-cache` and :any:`allow-query`. If neither of those parameters 2972 is set, the default (localnets; localhost;) is used. 2973 2974 .. namedconf:statement:: allow-recursion-on 2975 :tags: query, server 2976 :short: Specifies which local addresses can accept recursive queries. 2977 2978 This specifies which local addresses can accept recursive queries. If 2979 :any:`allow-recursion-on` is not set, then :any:`allow-query-cache-on` is 2980 used if set; otherwise, the default is to allow recursive queries on 2981 all addresses. Any client permitted to send recursive queries can 2982 send them to any address on which :iscman:`named` is listening. Note: both 2983 :any:`allow-recursion` and :any:`allow-recursion-on` must be satisfied 2984 before recursion is allowed; a client that is blocked by one cannot 2985 be allowed by the other. 2986 2987 .. namedconf:statement:: allow-update 2988 :tags: transfer 2989 :short: Defines an :any:`address_match_list` of hosts that are allowed to submit dynamic updates for primary zones. 2990 2991 This provides a simple access control list. 2992 When set in the :any:`zone` statement for a primary zone, this specifies which 2993 hosts are allowed to submit dynamic DNS updates to that zone. The 2994 default is to deny updates from all hosts. 2995 2996 Note that allowing updates based on the requestor's IP address is 2997 insecure; see :ref:`dynamic_update_security` for details. 2998 2999 In general, this option should only be set at the :any:`zone` level. 3000 While a default value can be set at the :namedconf:ref:`options` or :any:`view` level 3001 and inherited by zones, this could lead to some zones unintentionally 3002 allowing updates. 3003 3004 Updates are written to the zone's filename that is set in :any:`file`. 3005 3006 .. namedconf:statement:: allow-update-forwarding 3007 :tags: transfer 3008 :short: Defines an :any:`address_match_list` of hosts that are allowed to submit dynamic updates to a secondary server for transmission to a primary. 3009 3010 When set in the :any:`zone` statement for a secondary zone, this specifies which 3011 hosts are allowed to submit dynamic DNS updates and have them be 3012 forwarded to the primary. The default is ``{ none; }``, which means 3013 that no update forwarding is performed. 3014 3015 To enable update forwarding, specify 3016 ``allow-update-forwarding { any; };`` in the :any:`zone` statement. 3017 Specifying values other than ``{ none; }`` or ``{ any; }`` is usually 3018 counterproductive; the responsibility for update access control 3019 should rest with the primary server, not the secondary. 3020 3021 Note that enabling the update forwarding feature on a secondary server 3022 may expose primary servers to attacks if they rely on insecure 3023 IP-address-based access control; see :ref:`dynamic_update_security` for more details. 3024 3025 In general this option should only be set at the :any:`zone` level. 3026 While a default value can be set at the :namedconf:ref:`options` or :any:`view` level 3027 and inherited by zones, this can lead to some zones unintentionally 3028 forwarding updates. 3029 3030 .. namedconf:statement:: allow-transfer 3031 :tags: transfer 3032 :short: Defines an :any:`address_match_list` of hosts that are allowed to transfer the zone information from this server. 3033 3034 This specifies which hosts are allowed to receive zone transfers from the 3035 server. :any:`allow-transfer` may also be specified in the :any:`zone` 3036 statement, in which case it overrides the :any:`allow-transfer` 3037 statement set in :namedconf:ref:`options` or :any:`view`. 3038 3039 Transport-level limitations can also be specified. In particular, 3040 zone transfers can be restricted to a specific port and/or DNS 3041 transport protocol by using the options :term:`port` and ``transport``. 3042 Either option can be specified; if both are used, both constraints 3043 must be satisfied in order for the transfer to be allowed. Zone 3044 transfers are currently only possible via the TCP and TLS transports. 3045 3046 For example: ``allow-transfer port 853 transport tls { any; };`` 3047 allows outgoing zone transfers to any host using the TLS transport 3048 over port 853. 3049 3050 If :any:`allow-transfer` is not specified, then the default is 3051 ``none``; outgoing zone transfers are disabled. 3052 3053 .. warning:: 3054 3055 Please note that incoming TLS connections are 3056 **not authenticated at the TLS level by default**. 3057 Please use :ref:`tsig` to authenticate requestors 3058 or consider implementing :ref:`Mutual TLS <mutual-tls>` 3059 authentication. 3060 3061 .. namedconf:statement:: blackhole 3062 :tags: query 3063 :short: Defines an :any:`address_match_list` of hosts to ignore. The server will neither respond to queries from nor send queries to these addresses. 3064 3065 This specifies a list of addresses which the server does not accept queries 3066 from or or cannot use to resolve a query. Queries from these addresses are not 3067 responded to. The default is ``none``. 3068 3069 .. namedconf:statement:: no-case-compress 3070 :tags: server 3071 :short: Specifies a list of addresses that require case-insensitive compression in responses. 3072 3073 This specifies a list of addresses which require responses to use 3074 case-insensitive compression. This ACL can be used when :iscman:`named` 3075 needs to work with clients that do not comply with the requirement in 3076 :rfc:`1034` to use case-insensitive name comparisons when checking for 3077 matching domain names. 3078 3079 If left undefined, the ACL defaults to ``none``: case-sensitive 3080 compression is used for all clients. If the ACL is defined and 3081 matches a client, case is ignored when compressing domain 3082 names in DNS responses sent to that client. 3083 3084 This can result in slightly smaller responses; if a response contains 3085 the names "example.com" and "example.COM", case-insensitive 3086 compression treats the second one as a duplicate. It also 3087 ensures that the case of the query name exactly matches the case of 3088 the owner names of returned records, rather than matches the case of 3089 the records entered in the zone file. This allows responses to 3090 exactly match the query, which is required by some clients due to 3091 incorrect use of case-sensitive comparisons. 3092 3093 Case-insensitive compression is *always* used in AXFR and IXFR 3094 responses, regardless of whether the client matches this ACL. 3095 3096 There are circumstances in which :iscman:`named` does not preserve the case 3097 of owner names of records: if a zone file defines records of 3098 different types with the same name, but the capitalization of the 3099 name is different (e.g., "www.example.com/A" and 3100 "WWW.EXAMPLE.COM/AAAA"), then all responses for that name use 3101 the *first* version of the name that was used in the zone file. This 3102 limitation may be addressed in a future release. However, domain 3103 names specified in the rdata of resource records (i.e., records of 3104 type NS, MX, CNAME, etc.) always have their case preserved unless 3105 the client matches this ACL. 3106 3107 .. namedconf:statement:: resolver-query-timeout 3108 :tags: query 3109 :short: Specifies the length of time, in milliseconds, that a resolver attempts to resolve a recursive query before failing. 3110 3111 This is the amount of time, in milliseconds, that the resolver spends 3112 attempting to resolve a recursive query before failing. The default 3113 is ``10000``, the minimum is ``301``, and the maximum is ``30000``. 3114 Setting it to ``0`` results in the default being used. 3115 3116 This value was originally specified in seconds. Values less than or 3117 equal to 300 are treated as seconds and converted to 3118 milliseconds before applying the above limits. 3119 3120 .. _interfaces: 3121 3122 Interfaces 3123 ^^^^^^^^^^ 3124 3125 The interfaces, ports, and protocols that the server can use to answer 3126 queries may be specified using the :any:`listen-on` and :any:`listen-on-v6` options. 3127 3128 .. namedconf:statement:: listen-on 3129 :tags: server 3130 :short: Specifies the IPv4 addresses on which a server listens for DNS queries. 3131 3132 .. namedconf:statement:: listen-on-v6 3133 :tags: server 3134 :short: Specifies the IPv6 addresses on which a server listens for DNS queries. 3135 3136 The :any:`listen-on` and :any:`listen-on-v6` statements can each 3137 take an optional port, PROXYv2 support switch, TLS configuration 3138 identifier, and/or HTTP configuration identifier, in addition to an 3139 :term:`address_match_list`. 3140 3141 The :term:`address_match_list` in :any:`listen-on` specifies the IPv4 addresses 3142 on which the server will listen. (IPv6 addresses are ignored, with a 3143 logged warning.) The server listens on all interfaces allowed by the 3144 address match list. If no :any:`listen-on` is specified, the default is 3145 to listen for standard DNS queries on port 53 of all IPv4 interfaces. 3146 3147 :any:`listen-on-v6` takes an :term:`address_match_list` of IPv6 addresses. 3148 The server listens on all interfaces allowed by the address match list. 3149 If no :any:`listen-on-v6` is specified, the default is to listen for standard 3150 DNS queries on port 53 of all IPv6 interfaces. 3151 3152 When specified, the PROXYv2 support switch ``proxy`` allows 3153 the enabling of PROXYv2 protocol support. The PROXYv2 protocol 3154 provides the means for passing connection information, such as a 3155 client's source and destination addresses and ports, across 3156 multiple layers of NAT or TCP/UDP proxies to back-end servers. The 3157 addresses passed by the PROXYv2 protocol are then used, instead 3158 of the peer and interface addresses provided by the operating 3159 system. 3160 3161 The ``proxy`` switch can have the following values: 3162 3163 * ``plain`` - accept plain PROXYv2 headers. This is the only valid 3164 option for transports that do not employ encryption. In the case 3165 of transports that employ encryption, this value instructs BIND that 3166 PROXYv2 headers are sent without encryption before the TLS 3167 handshake. In that case, only PROXYv2 headers are not encrypted. 3168 * ``encrypted`` - accept encrypted PROXYv2 headers. This value 3169 instructs BIND that PROXYv2 headers are sent encrypted immediately 3170 after the TLS handshake. The option is valid only for transports 3171 that employ encryption; encrypted PROXYv2 headers cannot be sent 3172 via unencrypted transports. 3173 3174 Please consult the documentation of any proxying front-end software to 3175 decide which value should be used. If in doubt, use ``plain`` for 3176 encrypted transports, especially for DNS-over-HTTPS (DoH), but 3177 DNS-specific software is likely to need ``encrypted``. 3178 3179 It should be noted that when PROXYv2 is enabled on a listener, it 3180 loses the ability to accept regular DNS queries without associated 3181 PROXYv2 headers. 3182 3183 In some cases, PROXYv2 headers might not contain usable source and 3184 destination addresses. In particular, this can happen when the headers 3185 use the ``LOCAL`` command, or headers use address types that are unspecified or 3186 unsupported by BIND. If otherwise correct, such 3187 headers are accepted by BIND and the real endpoint addresses are 3188 used in these cases. 3189 3190 The PROXYv2 protocol is designed to be extensible and can carry 3191 additional information in the form of type-length-values 3192 (TLVs). Many of the types are defined in the protocol 3193 specification, and for some of these, BIND does a reasonable amount of 3194 validation in order to detect and reject ill-formed or hand-crafted 3195 headers. Apart from that, this additional data, while accepted, is 3196 not currently used by BIND for anything else. 3197 3198 By default, no client is allowed to send queries that contain 3199 PROXYv2 protocol headers, even when support for the protocol is 3200 enabled in a :any:`listen-on` statement. Users who are interested in 3201 enabling the PROXYv2 protocol support may also want to 3202 look at the :namedconf:ref:`allow-proxy` and 3203 :namedconf:ref:`allow-proxy-on` options, to adjust the corresponding 3204 ACLs. 3205 3206 If a TLS configuration is specified, :iscman:`named` will listen for DNS-over-TLS 3207 (DoT) connections, using the key and certificate specified in the 3208 referenced :any:`tls` statement. If the name ``ephemeral`` is used, 3209 an ephemeral key and certificate created for the currently running 3210 :iscman:`named` process will be used. 3211 3212 If an HTTP configuration is specified, :iscman:`named` listens for 3213 DNS-over-HTTPS (DoH) connections using the HTTP endpoint specified in the 3214 referenced :any:`http` statement. If the name ``default`` is used, then 3215 :iscman:`named` listens for connections at the default endpoint, 3216 ``/dns-query``. 3217 3218 Use of an :any:`http` specification requires :any:`tls` to be specified 3219 as well. If an unencrypted connection is desired (for example, 3220 on load-sharing servers behind a reverse proxy), ``tls none`` may be used. 3221 3222 If a port number is not specified, the default is 53 for standard DNS, 3223 853 for DNS over TLS, 443 for DNS over HTTPS, and 80 for 3224 DNS over HTTP (unencrypted). These defaults may be overridden using the 3225 :namedconf:ref:`port`, :any:`tls-port`, :any:`https-port`, and :any:`http-port` options. 3226 3227 Multiple :any:`listen-on` statements are allowed. For example: 3228 3229 :: 3230 3231 listen-on { 5.6.7.8; }; 3232 listen-on port 1234 { !1.2.3.4; 1.2/16; }; 3233 listen-on port 8853 tls ephemeral { 4.3.2.1; }; 3234 listen-on port 8453 tls ephemeral http myserver { 8.7.6.5; }; 3235 listen-on port 5300 proxy plain { !1.2.3.4; 1.2/16; }; 3236 listen-on port 8953 proxy encrypted tls ephemeral { 4.3.2.1; }; 3237 listen-on port 8553 proxy plain tls ephemeral http myserver { 8.7.6.5; }; 3238 3239 The first two lines instruct the name server to listen for standard DNS 3240 queries on port 53 of the IP address 5.6.7.8 and on port 1234 of an address 3241 on the machine in net 1.2 that is not 1.2.3.4. The third line instructs the 3242 server to listen for DNS-over-TLS connections on port 8853 of the IP 3243 address 4.3.2.1 using the ephemeral key and certifcate. The fourth line 3244 enables DNS-over-HTTPS connections on port 8453 of address 8.7.6.5, using 3245 the ephemeral key and certificate, and the HTTP endpoint or endpoints 3246 configured in an :any:`http` statement with the name ``myserver``. 3247 3248 Multiple :any:`listen-on-v6` options can be used. For example: 3249 3250 :: 3251 3252 listen-on-v6 { any; }; 3253 listen-on-v6 port 1234 { !2001:db8::/32; any; }; 3254 listen-on-v6 port 8853 tls example-tls { 2001:db8::100; }; 3255 listen-on-v6 port 8453 tls example-tls http default { 2001:db8::100; }; 3256 listen-on-v6 port 8000 tls none http myserver { 2001:db8::100; }; 3257 listen-on-v6 port 53000 proxy plain { !2001:db8::/32; any; }; 3258 listen-on-v6 port 8953 proxy encrypted tls example-tls { 2001:db8::100; }; 3259 listen-on-v6 port 8553 proxy plain tls example-tls http default { 2001:db8::100; }; 3260 3261 The first two lines instruct the name server to listen for standard DNS 3262 queries on port 53 of any IPv6 addresses, and on port 1234 of IPv6 3263 addresses that are not in the prefix 2001:db8::/32. The third line 3264 instructs the server to listen for for DNS-over-TLS connections on port 3265 8853 of the address 2001:db8::100, using a TLS key and certificate specified 3266 in the a :any:`tls` statement with the name ``example-tls``. The fourth 3267 instructs the server to listen for DNS-over-HTTPS connections, again using 3268 ``example-tls``, on the default HTTP endpoint. The fifth line, in which 3269 the :any:`tls` parameter is set to ``none``, instructs the server to listen 3270 for *unencrypted* DNS queries over HTTP at the endpoint specified in 3271 ``myserver``.. 3272 3273 To instruct the server not to listen on any IPv6 addresses, use: 3274 3275 :: 3276 3277 listen-on-v6 { none; }; 3278 3279 .. _query_address: 3280 3281 Query Address 3282 ^^^^^^^^^^^^^ 3283 3284 .. namedconf:statement:: query-source 3285 :tags: query 3286 :short: Controls the IPv4 address from which queries are issued. If 3287 `none`, then no IPv4 address would be used to issue the 3288 query and therefore only IPv6 servers are queried. 3289 3290 .. namedconf:statement:: query-source-v6 3291 :tags: query 3292 :short: Controls the IPv6 address from which queries are issued. If 3293 `none`, then no IPv6 address would be used to issue the 3294 query and therefore only IPv4 servers are quried. 3295 3296 If the server does not know the answer to a question, it queries other 3297 name servers. :any:`query-source` specifies the address and port used for 3298 such queries. For queries sent over IPv6, there is a separate 3299 :any:`query-source-v6` option. If ``address`` is ``*`` (asterisk) or is 3300 omitted, a wildcard IP address (``INADDR_ANY``) is used. 3301 3302 The defaults of the :any:`query-source` and :any:`query-source-v6` options 3303 are: 3304 3305 :: 3306 3307 query-source address * port *; 3308 query-source-v6 address * port *; 3309 3310 .. note:: ``port`` configuration is deprecated. A warning will be logged 3311 when this parameter is used. 3312 3313 .. note:: The address specified in the :any:`query-source` option is 3314 used for both UDP and TCP queries, but the port applies only to UDP 3315 queries. TCP queries always use a random unprivileged port. 3316 3317 .. namedconf:statement:: use-v4-udp-ports 3318 :tags: deprecated 3319 :short: Specifies a list of ports that are valid sources for UDP/IPv4 messages. 3320 3321 .. namedconf:statement:: use-v6-udp-ports 3322 :tags: deprecated 3323 :short: Specifies a list of ports that are valid sources for UDP/IPv6 messages. 3324 3325 These statements, which are deprecated and will be removed in a future 3326 release, specify a list of IPv4 and IPv6 UDP ports that are used as 3327 source ports for UDP messages. 3328 3329 If :term:`port` is ``*`` or is omitted, a random port number from a 3330 pre-configured range is selected and used for each query. The 3331 port range(s) are specified in the :any:`use-v4-udp-ports` (for IPv4) 3332 and :any:`use-v6-udp-ports` (for IPv6) options. 3333 3334 If :any:`use-v4-udp-ports` or :any:`use-v6-udp-ports` is unspecified, 3335 :iscman:`named` checks whether the operating system provides a programming 3336 interface to retrieve the system's default range for ephemeral ports. If 3337 such an interface is available, :iscman:`named` uses the corresponding 3338 system default range; otherwise, it uses its own defaults: 3339 3340 :: 3341 3342 use-v4-udp-ports { range 1024 65535; }; 3343 use-v6-udp-ports { range 1024 65535; }; 3344 3345 .. namedconf:statement:: avoid-v4-udp-ports 3346 :tags: deprecated 3347 :short: Specifies the range(s) of ports to be excluded from use as sources for UDP/IPv4 messages. 3348 3349 .. namedconf:statement:: avoid-v6-udp-ports 3350 :tags: deprecated 3351 :short: Specifies the range(s) of ports to be excluded from use as sources for UDP/IPv6 messages. 3352 3353 These statements, which are deprecated and will be removed in a future 3354 release, indicate ranges of port numbers to exclude from those specified 3355 in the :any:`avoid-v4-udp-ports` and :any:`avoid-v6-udp-ports` 3356 options, respectively. 3357 3358 The defaults of the :any:`avoid-v4-udp-ports` and :any:`avoid-v6-udp-ports` 3359 options are: 3360 3361 :: 3362 3363 avoid-v4-udp-ports {}; 3364 avoid-v6-udp-ports {}; 3365 3366 For example, with the following configuration: 3367 3368 :: 3369 3370 use-v6-udp-ports { range 32768 65535; }; 3371 avoid-v6-udp-ports { 40000; range 50000 60000; }; 3372 3373 UDP ports of IPv6 messages sent from :iscman:`named` are in one of the 3374 following ranges: 32768 to 39999, 40001 to 49999, or 60001 to 65535. 3375 3376 :any:`avoid-v4-udp-ports` and :any:`avoid-v6-udp-ports` can be used to prevent 3377 :iscman:`named` from choosing as its random source port a port that is blocked 3378 by a firewall or that is used by other applications; if a 3379 query went out with a source port blocked by a firewall, the answer 3380 would not pass through the firewall and the name server would have to query 3381 again. Note: the desired range can also be represented only with 3382 :any:`use-v4-udp-ports` and :any:`use-v6-udp-ports`, and the ``avoid-`` 3383 options are redundant in that sense; they are provided for backward 3384 compatibility and to possibly simplify the port specification. 3385 3386 .. note:: Make sure the ranges are sufficiently large for security. A 3387 desirable size depends on several parameters, but we generally recommend 3388 it contain at least 16384 ports (14 bits of entropy). Note also that the 3389 system's default range when used may be too small for this purpose, and 3390 that the range may even be changed while :iscman:`named` is running; the new 3391 range is automatically applied when :iscman:`named` is reloaded. Explicit 3392 configuration of :any:`use-v4-udp-ports` and :any:`use-v6-udp-ports` is encouraged, 3393 so that the ranges are sufficiently large and are reasonably 3394 independent from the ranges used by other applications. 3395 3396 .. note:: The operational configuration where :iscman:`named` runs may prohibit 3397 the use of some ports. For example, Unix systems do not allow 3398 :iscman:`named`, if run without root privilege, to use ports less than 1024. 3399 If such ports are included in the specified (or detected) set of query 3400 ports, the corresponding query attempts will fail, resulting in 3401 resolution failures or delay. It is therefore important to configure the 3402 set of ports that can be safely used in the expected operational 3403 environment. 3404 3405 .. warning:: Specifying a single port is discouraged, as it removes a layer of 3406 protection against spoofing errors. 3407 3408 .. warning:: The configured :term:`port` must not be the same as the listening port. 3409 3410 .. note:: See also :any:`transfer-source`, :any:`notify-source` and :any:`parental-source`. 3411 3412 .. _zone_transfers: 3413 3414 Zone Transfers 3415 ^^^^^^^^^^^^^^ 3416 3417 BIND has mechanisms in place to facilitate zone transfers and set limits 3418 on the amount of load that transfers place on the system. The following 3419 options apply to zone transfers. 3420 3421 .. namedconf:statement:: also-notify 3422 :tags: transfer 3423 :short: Defines one or more hosts that are sent ``NOTIFY`` messages when zone changes occur. 3424 3425 This option defines a global list of IP addresses of name servers that are also 3426 sent NOTIFY messages whenever a fresh copy of the zone is loaded, in 3427 addition to the servers listed in the zone's NS records. This helps 3428 to ensure that copies of the zones quickly converge on stealth 3429 servers. Optionally, a port may be specified with each 3430 :any:`also-notify` address to send the notify messages to a port other 3431 than the default of 53. An optional TSIG key can also be specified 3432 with each address to cause the notify messages to be signed; this can 3433 be useful when sending notifies to multiple views. In place of 3434 explicit addresses, one or more named :any:`primaries` lists can be used. 3435 3436 If an :any:`also-notify` list is given in a :any:`zone` statement, it 3437 overrides the ``options also-notify`` statement. When a 3438 ``zone notify`` statement is set to ``no``, the IP addresses in the 3439 global :any:`also-notify` list are not sent NOTIFY messages for that 3440 zone. The default is the empty list (no global notification list). 3441 3442 .. namedconf:statement:: min-transfer-rate-in 3443 :tags: transfer 3444 :short: Specifies the minimum traffic rate below which inbound zone transfers are terminated. 3445 3446 Inbound zone transfers running slower than the given amount of bytes in the 3447 given amount of minutes are terminated. This option takes two non-zero integer values. 3448 A check is performed periodically every time the configured time interval 3449 passes. The default value is ``10240 5``, i.e. 10240 bytes in 5 minutes. 3450 The maximum time value is 28 days (40320 minutes). 3451 3452 .. namedconf:statement:: max-transfer-time-in 3453 :tags: transfer 3454 :short: Specifies the number of minutes after which inbound zone transfers are terminated. 3455 3456 Inbound zone transfers running longer than this many minutes are 3457 terminated. The default is 120 minutes (2 hours). The maximum value 3458 is 28 days (40320 minutes). 3459 3460 .. namedconf:statement:: max-transfer-idle-in 3461 :tags: transfer 3462 :short: Specifies the number of minutes after which inbound zone transfers making no progress are terminated. 3463 3464 Inbound zone transfers making no progress in this many minutes are 3465 terminated. The default is 60 minutes (1 hour). The maximum value 3466 is 28 days (40320 minutes). 3467 3468 .. note:: Inbound zone transfers are also affected by 3469 ``tcp-idle-timeout``; ``max-transfer-idle-in`` closes the 3470 inbound zone transfer if there is no complete AXFR or no complete 3471 IXFR chunk. ``tcp-idle-timeout`` closes the connection if 3472 there is no progress on the TCP level. 3473 3474 .. namedconf:statement:: max-transfer-time-out 3475 :tags: transfer 3476 :short: Specifies the number of minutes after which outbound zone transfers are terminated. 3477 3478 Outbound zone transfers running longer than this many minutes are 3479 terminated. The default is 120 minutes (2 hours). The maximum value 3480 is 28 days (40320 minutes). 3481 3482 .. namedconf:statement:: max-transfer-idle-out 3483 :tags: transfer 3484 :short: Specifies the number of minutes after which outbound zone transfers making no progress are terminated. 3485 3486 Outbound zone transfers making no progress in this many minutes are 3487 terminated. The default is 60 minutes (1 hour). The maximum value 3488 is 28 days (40320 minutes). 3489 3490 .. namedconf:statement:: notify-rate 3491 :tags: transfer, zone 3492 :short: Specifies the rate at which NOTIFY requests are sent during normal zone maintenance operations. 3493 3494 This specifies the rate at which NOTIFY requests are sent during normal zone 3495 maintenance operations. (NOTIFY requests due to initial zone loading 3496 are subject to a separate rate limit; see below.) The default is 20 3497 per second. The lowest possible rate is one per second; when set to 3498 zero, it is silently raised to one. 3499 3500 .. namedconf:statement:: primaries 3501 :tags: transfer, zone 3502 :short: Defines one or more servers that zone transfer can be requested from. 3503 3504 This specifies a list of one or more IP addresses of primary servers that 3505 the secondary contacts to update its copy of the zone. Primaries list 3506 elements can also be names of :any:`remote-servers` blocks. 3507 3508 By default, transfers are made from port 53 on the servers; this can be 3509 changed for all servers by specifying a port number before the list of IP 3510 addresses, or on a per-server basis after the IP address. Authentication to 3511 the primary can also be done with per-server TSIG keys. 3512 3513 .. namedconf:statement:: startup-notify-rate 3514 :tags: transfer, zone 3515 :short: Specifies the rate at which NOTIFY requests are sent when the name server is first starting, or when new zones have been added. 3516 3517 This is the rate at which NOTIFY requests are sent when the name server 3518 is first starting up, or when zones have been newly added to the 3519 name server. The default is 20 per second. The lowest possible rate is 3520 one per second; when set to zero, it is silently raised to one. 3521 3522 .. namedconf:statement:: serial-query-rate 3523 :tags: transfer 3524 :short: Defines an upper limit on the number of queries per second issued by the server, when querying the SOA RRs used for zone transfers. 3525 3526 Secondary servers periodically query primary servers to find out if 3527 zone serial numbers have changed. Each such query uses a minute 3528 amount of the secondary server's network bandwidth. To limit the amount 3529 of bandwidth used, BIND 9 limits the rate at which queries are sent. 3530 The value of the :any:`serial-query-rate` option, an integer, is the 3531 maximum number of queries sent per second. The default is 20 per 3532 second. The lowest possible rate is one per second; when set to zero, 3533 it is silently raised to one. 3534 3535 .. namedconf:statement:: transfer-format 3536 :tags: transfer 3537 :short: Controls whether multiple records can be packed into a message during zone transfers. 3538 3539 Zone transfers can be sent using two different formats, 3540 ``one-answer`` and ``many-answers``. The :any:`transfer-format` option 3541 is used on the primary server to determine which format it sends. 3542 ``one-answer`` uses one DNS message per resource record transferred. 3543 ``many-answers`` packs as many resource records as possible into one 3544 message. ``many-answers`` is more efficient; the default is ``many-answers``. 3545 :any:`transfer-format` may be overridden on a per-server basis by using 3546 the :namedconf:ref:`server` block. 3547 3548 .. namedconf:statement:: transfer-message-size 3549 :tags: transfer 3550 :short: Limits the uncompressed size of DNS messages used in zone transfers over TCP. 3551 3552 This is an upper bound on the uncompressed size of DNS messages used 3553 in zone transfers over TCP. If a message grows larger than this size, 3554 additional messages are used to complete the zone transfer. 3555 (Note, however, that this is a hint, not a hard limit; if a message 3556 contains a single resource record whose RDATA does not fit within the 3557 size limit, a larger message will be permitted so the record can be 3558 transferred.) 3559 3560 Valid values are between 512 and 65535 octets; any values outside 3561 that range are adjusted to the nearest value within it. The 3562 default is ``20480``, which was selected to improve message 3563 compression; most DNS messages of this size will compress to less 3564 than 16536 bytes. Larger messages cannot be compressed as 3565 effectively, because 16536 is the largest permissible compression 3566 offset pointer in a DNS message. 3567 3568 This option is mainly intended for server testing; there is rarely 3569 any benefit in setting a value other than the default. 3570 3571 .. namedconf:statement:: transfers-in 3572 :tags: transfer 3573 :short: Limits the number of concurrent inbound zone transfers. 3574 3575 This is the maximum number of inbound zone transfers that can run 3576 concurrently. The default value is ``10``. Increasing 3577 :any:`transfers-in` may speed up the convergence of secondary zones, but it 3578 also may increase the load on the local system. 3579 3580 .. namedconf:statement:: transfers-out 3581 :tags: transfer 3582 :short: Limits the number of concurrent outbound zone transfers. 3583 3584 This is the maximum number of outbound zone transfers that can run 3585 concurrently. Zone transfer requests in excess of the limit are 3586 refused. The default value is ``10``. 3587 3588 .. namedconf:statement:: transfers-per-ns 3589 :tags: transfer 3590 :short: Limits the number of concurrent inbound zone transfers from a remote server. 3591 3592 This is the maximum number of inbound zone transfers that can concurrently 3593 transfer from a given remote name server. The default value is 3594 ``2``. Increasing :any:`transfers-per-ns` may speed up the convergence 3595 of secondary zones, but it also may increase the load on the remote name 3596 server. :any:`transfers-per-ns` may be overridden on a per-server basis 3597 by using the :any:`transfers` phrase of the :namedconf:ref:`server` statement. 3598 3599 .. namedconf:statement:: transfer-source 3600 :tags: transfer 3601 :short: Defines which local IPv4 address(es) are bound to TCP connections used to fetch zones transferred inbound by the server. 3602 3603 :any:`transfer-source` determines which local address is bound to 3604 IPv4 TCP connections used to fetch zones transferred inbound by the 3605 server. It also determines the source IPv4 address, and optionally 3606 the UDP port, used for the refresh queries and forwarded dynamic 3607 updates. If not set, it defaults to a system-controlled value which 3608 is usually the address of the interface "closest to" the remote 3609 end. This address must appear in the remote end's :any:`allow-transfer` 3610 option for the zone being transferred, if one is specified. This 3611 statement sets the :any:`transfer-source` for all zones, but can be 3612 overridden on a per-view or per-zone basis by including a 3613 :any:`transfer-source` statement within the :any:`view` or :any:`zone` block 3614 in the configuration file. 3615 3616 .. note:: ``port`` configuration is deprecated. A warning will be logged 3617 when this parameter is used. 3618 3619 .. warning:: Specifying a single port is discouraged, as it removes a layer of 3620 protection against spoofing errors. 3621 3622 .. warning:: The configured :term:`port` must not be the same as the listening port. 3623 3624 .. namedconf:statement:: transfer-source-v6 3625 :tags: transfer 3626 :short: Defines which local IPv6 address(es) are bound to TCP connections used to fetch zones transferred inbound by the server. 3627 3628 This option is the same as :any:`transfer-source`, except zone transfers 3629 are performed using IPv6. 3630 3631 .. namedconf:statement:: notify-source 3632 :tags: transfer 3633 :short: Defines the IPv4 address (and optional port) to be used for outgoing ``NOTIFY`` messages. 3634 3635 :any:`notify-source` determines which local source address, and 3636 optionally UDP port, is used to send NOTIFY messages. This 3637 address must appear in the secondary server's :any:`primaries` zone clause or 3638 in an :any:`allow-notify` clause. This statement sets the 3639 :any:`notify-source` for all zones, but can be overridden on a per-zone 3640 or per-view basis by including a :any:`notify-source` statement within 3641 the :any:`zone` or :any:`view` block in the configuration file. 3642 3643 .. note:: ``port`` configuration is deprecated. A warning will be logged 3644 when this parameter is used. 3645 3646 .. warning:: Specifying a single port is discouraged, as it removes a layer of 3647 protection against spoofing errors. 3648 3649 .. warning:: The configured :term:`port` must not be the same as the listening port. 3650 3651 .. namedconf:statement:: notify-source-v6 3652 :tags: transfer 3653 :short: Defines the IPv6 address (and optional port) to be used for outgoing ``NOTIFY`` messages. 3654 3655 This option acts like :any:`notify-source`, but applies to ``NOTIFY`` messages sent to IPv6 3656 addresses. 3657 3658 .. _server_resource_limits: 3659 3660 Server Resource Limits 3661 ^^^^^^^^^^^^^^^^^^^^^^ 3662 3663 The following options set limits on the server's resource consumption 3664 that are enforced internally by the server rather than by the operating 3665 system. 3666 3667 .. namedconf:statement:: max-journal-size 3668 :tags: transfer 3669 :short: Controls the size of journal files. 3670 3671 This sets a maximum size for each journal file (see :ref:`journal`), 3672 expressed in bytes or, if followed by an 3673 optional unit suffix ('k', 'm', or 'g'), in kilobytes, megabytes, or 3674 gigabytes. When the journal file approaches the specified size, some 3675 of the oldest transactions in the journal are automatically 3676 removed. The largest permitted value is 2 gigabytes. Very small 3677 values are rounded up to 4096 bytes. It is possible to specify ``unlimited``, 3678 which also means 2 gigabytes. If the limit is set to ``default`` or 3679 left unset, the journal is allowed to grow up to twice as large 3680 as the zone. (There is little benefit in storing larger journals.) 3681 3682 This option may also be set on a per-zone basis. 3683 3684 .. namedconf:statement:: max-records 3685 :tags: zone, server 3686 :short: Sets the maximum number of records permitted in a zone. 3687 3688 This sets the maximum number of records permitted in a zone. The default is 3689 zero, which means the maximum is unlimited. 3690 3691 .. namedconf:statement:: max-records-per-type 3692 :tags: server 3693 :short: Sets the maximum number of records that can be stored in an RRset. 3694 3695 This sets the maximum number of resource records that can be stored 3696 in an RRset in a database. When configured in :namedconf:ref:`options` 3697 or :namedconf:ref:`view`, it controls the cache database; it also sets 3698 the default value for zone databases, which can be overridden by setting 3699 it at the :namedconf:ref:`zone` level. 3700 3701 If set to a positive value, any attempt to cache, or to add to a zone 3702 an RRset with more than the specified number of records, will result in 3703 a failure. If set to 0, there is no cap on RRset size. The default is 3704 100. 3705 3706 .. namedconf:statement:: max-types-per-name 3707 :tags: server 3708 :short: Sets the maximum number of RR types that can be stored for an owner name. 3709 3710 This sets the maximum number of resource record types that can be stored 3711 for a single owner name in a database. When configured in 3712 :namedconf:ref:`options` or :namedconf:ref:`view`, it controls the cache 3713 database and sets the default value for zone databases, which can be 3714 overridden by setting it at the :namedconf:ref:`zone` level. 3715 3716 An RR type and its corresponding signature are counted as two types. So, 3717 for example, a signed node containing A and AAAA records has four types: 3718 A, RRSIG(A), AAAA, and RRSIG(AAAA). 3719 3720 The behavior is slightly different for zone and cache databases: 3721 3722 In a zone, if :any:`max-types-per-name` is set to a positive number, any 3723 attempt to add a new resource record set to a name that already has the 3724 specified number of types will fail. 3725 3726 In a cache, if :any:`max-types-per-name` is set to a positive number, an 3727 attempt to add a new resource record set to a name that already has the 3728 specified number of types will temporarily succeed, so that the query can 3729 be answered. However, the newly added RRset will immediately be purged. 3730 3731 Certain high-priority types, including SOA, CNAME, DNSKEY, and their 3732 corresponding signatures, are always cached. If :any:`max-types-per-name` 3733 is set to a very low value, then it may be ignored to allow high-priority 3734 types to be cached. 3735 3736 When :any:`max-types-per-name` is set to 0, there is no cap on the number 3737 of RR types. The default is 100. 3738 3739 .. namedconf:statement:: recursive-clients 3740 :tags: query 3741 :short: Specifies the maximum number of concurrent recursive queries the server can perform. 3742 3743 This sets the maximum number (a "hard quota") of simultaneous recursive lookups 3744 the server performs on behalf of clients. The default is 3745 ``1000``. Because each recursing client uses a fair bit of memory (on 3746 the order of 20 kilobytes), the value of the :any:`recursive-clients` 3747 option may have to be decreased on hosts with limited memory. 3748 3749 :any:`recursive-clients` defines a "hard quota" limit for pending 3750 recursive clients; when more clients than this are pending, new 3751 incoming requests are not accepted, and for each incoming request 3752 a previous pending request is dropped. 3753 3754 A "soft quota" is also set. When this lower quota is exceeded, 3755 incoming requests are accepted, but for each one, a pending request 3756 is dropped. If :any:`recursive-clients` is greater than 1000, the 3757 soft quota is set to :any:`recursive-clients` minus 100; otherwise it is 3758 set to 90% of :any:`recursive-clients`. 3759 3760 .. namedconf:statement:: tcp-clients 3761 :tags: server 3762 :short: Specifies the maximum number of simultaneous client TCP connections accepted by the server. 3763 3764 This is the maximum number of simultaneous client TCP connections that the 3765 server accepts. The default is ``150``. 3766 3767 .. namedconf:statement:: clients-per-query 3768 :tags: server 3769 :short: Sets the initial minimum number of simultaneous recursive clients accepted by the server for any given query before the server drops additional clients. 3770 3771 This sets the initial value (minimum) number of simultaneous recursive clients 3772 for any given query (<qname,qtype,qclass>) that the server accepts before 3773 dropping additional clents. :iscman:`named` attempts to self-tune this 3774 value and changes are logged. The default value is 10. 3775 3776 The chosen value should reflect how many queries come in for a given name 3777 in the time it takes to resolve that name. 3778 3779 .. namedconf:statement:: max-clients-per-query 3780 :tags: server 3781 :short: Sets the maximum number of simultaneous recursive clients accepted by the server for any given query before the server drops additional clients. 3782 3783 This sets the maximum number of simultaneous recursive clients for any 3784 given query (<qname,qtype,qclass>) that the server accepts before 3785 dropping additional clients. 3786 3787 If the number of queries exceeds :any:`clients-per-query`, :iscman:`named` 3788 assumes that it is dealing with a non-responsive zone and drops additional 3789 queries. If it gets a response after dropping queries, it raises the estimate, 3790 up to a limit of :any:`max-clients-per-query`. The estimate is then lowered 3791 after 20 minutes if it has remained unchanged. 3792 3793 If :any:`max-clients-per-query` is set to zero, there is no upper bound, other 3794 than that imposed by :any:`recursive-clients`. If the option is set to a 3795 lower value than :any:`clients-per-query`, the value is adjusted to 3796 :any:`clients-per-query`. 3797 3798 If :any:`clients-per-query` is set to zero, :any:`max-clients-per-query` no 3799 longer applies and there is no upper bound, other than that imposed by 3800 :any:`recursive-clients`. 3801 3802 .. namedconf:statement:: max-validations-per-fetch 3803 :tags: server 3804 :short: Sets the maximum number of DNSSEC validations that can happen in a single fetch. 3805 3806 This is an **experimental** setting that defines the maximum number of DNSSEC 3807 validations that can happen in a single resolver fetch. The default is 16. 3808 3809 .. namedconf:statement:: max-validation-failures-per-fetch 3810 :tags: server 3811 :short: Sets the maximum number of DNSSEC validation failures that can happen in a single fetch. 3812 3813 This is an **experimental** setting that defines the maximum number of DNSSEC 3814 validation failures that can happen in a single resolver fetch. The default 3815 is 1. 3816 3817 .. namedconf:statement:: fetches-per-zone 3818 :tags: server, query 3819 :short: Sets the maximum number of simultaneous iterative queries allowed to any one domain before the server blocks new queries for data in or beneath that zone. 3820 3821 This sets the maximum number of simultaneous iterative queries to any one 3822 domain that the server permits before blocking new queries for 3823 data in or beneath that zone. This value should reflect how many 3824 fetches would normally be sent to any one zone in the time it would 3825 take to resolve them. It should be smaller than 3826 :any:`recursive-clients`. 3827 3828 When many clients simultaneously query for the same name and type, 3829 the clients are all attached to the same fetch, up to the 3830 :any:`max-clients-per-query` limit, and only one iterative query is 3831 sent. However, when clients are simultaneously querying for 3832 *different* names or types, multiple queries are sent and 3833 :any:`max-clients-per-query` is not effective as a limit. 3834 3835 Optionally, this value may be followed by the keyword ``drop`` or 3836 ``fail``, indicating whether queries which exceed the fetch quota for 3837 a zone are dropped with no response, or answered with SERVFAIL. 3838 The default is ``drop``. 3839 3840 If :any:`fetches-per-zone` is set to zero, there is no limit on the 3841 number of fetches per query and no queries are dropped. The 3842 default is zero. 3843 3844 The current list of active fetches can be dumped by running 3845 :option:`rndc recursing`. The list includes the number of active fetches 3846 for each domain and the number of queries that have been passed 3847 (allowed) or dropped (spilled) as a result of the :any:`fetches-per-zone` 3848 limit. (Note: these counters are not cumulative over time; 3849 whenever the number of active fetches for a domain drops to zero, 3850 the counter for that domain is deleted, and the next time a fetch 3851 is sent to that domain, it is recreated with the counters set 3852 to zero.) 3853 3854 .. note:: 3855 3856 Fetches generated automatically in the result of :any:`prefetch` are 3857 exempt from this quota. 3858 3859 .. namedconf:statement:: fetches-per-server 3860 :tags: server, query 3861 :short: Sets the maximum number of simultaneous iterative queries allowed to be sent by a server to an upstream name server before the server blocks additional queries. 3862 3863 This sets the maximum number of simultaneous iterative queries that the server 3864 allows to be sent to a single upstream name server before 3865 blocking additional queries. This value should reflect how many 3866 fetches would normally be sent to any one server in the time it would 3867 take to resolve them. It should be smaller than 3868 :any:`recursive-clients`. 3869 3870 Optionally, this value may be followed by the keyword ``drop`` or 3871 ``fail``, indicating whether queries are dropped with no 3872 response or answered with SERVFAIL, when all of the servers 3873 authoritative for a zone are found to have exceeded the per-server 3874 quota. The default is ``fail``. 3875 3876 If :any:`fetches-per-server` is set to zero, there is no limit on 3877 the number of fetches per query and no queries are dropped. The 3878 default is zero. 3879 3880 The :any:`fetches-per-server` quota is dynamically adjusted in response 3881 to detected congestion. As queries are sent to a server and either are 3882 answered or time out, an exponentially weighted moving average 3883 is calculated of the ratio of timeouts to responses. If the current 3884 average timeout ratio rises above a "high" threshold, then 3885 :any:`fetches-per-server` is reduced for that server. If the timeout 3886 ratio drops below a "low" threshold, then :any:`fetches-per-server` is 3887 increased. The :any:`fetch-quota-params` options can be used to adjust 3888 the parameters for this calculation. 3889 3890 .. note:: 3891 3892 Fetches generated automatically in the result of :any:`prefetch` are 3893 exempt from this quota, but they are included in the quota calculations. 3894 3895 .. namedconf:statement:: fetch-quota-params 3896 :tags: server, query 3897 :short: Sets the parameters for dynamic resizing of the :any:`fetches-per-server` quota in response to detected congestion. 3898 3899 This sets the parameters to use for dynamic resizing of the 3900 :any:`fetches-per-server` quota in response to detected congestion. 3901 3902 The first argument is an integer value indicating how frequently to 3903 recalculate the moving average of the ratio of timeouts to responses 3904 for each server. The default is 100, meaning that BIND recalculates the 3905 average ratio after every 100 queries have either been answered or 3906 timed out. 3907 3908 The remaining three arguments represent the "low" threshold 3909 (defaulting to a timeout ratio of 0.1), the "high" threshold 3910 (defaulting to a timeout ratio of 0.3), and the discount rate for the 3911 moving average (defaulting to 0.7). A higher discount rate causes 3912 recent events to weigh more heavily when calculating the moving 3913 average; a lower discount rate causes past events to weigh more 3914 heavily, smoothing out short-term blips in the timeout ratio. These 3915 arguments are all fixed-point numbers with precision of 1/100; at 3916 most two places after the decimal point are significant. 3917 3918 .. namedconf:statement:: max-cache-size 3919 :tags: server 3920 :short: Sets the maximum amount of memory to use for an individual cache database and its associated metadata. 3921 3922 This sets the maximum amount of memory to use for an individual cache 3923 database and its associated metadata, in bytes or percentage of total 3924 physical memory. By default, each view has its own separate cache, 3925 which means the total amount of memory required for cache data is the 3926 sum of the cache database sizes for all views (unless the 3927 :any:`attach-cache` option is used). 3928 3929 When the amount of data in a cache database reaches the configured 3930 limit, :iscman:`named` starts purging non-expired records (following an 3931 LRU-based strategy). 3932 3933 The default size limit for each individual cache is: 3934 3935 - 90% of physical memory for views with :any:`recursion` set to 3936 ``yes`` (the default), or 3937 3938 - 2 MB for views with :any:`recursion` set to ``no``. 3939 3940 Any positive value smaller than 2 MB is ignored and reset to 2 MB. 3941 The keyword ``unlimited``, or the value ``0``, places no limit on the 3942 cache size; records are then purged from the cache only when they 3943 expire (according to their TTLs). 3944 3945 .. note:: 3946 3947 For configurations which define multiple views with separate 3948 caches and recursion enabled, it is recommended to set 3949 :any:`max-cache-size` appropriately for each view, as using the 3950 default value of that option (90% of physical memory for each 3951 individual cache) may lead to memory exhaustion over time. 3952 3953 .. note:: 3954 3955 :any:`max-cache-size` does not work reliably for a maximum 3956 amount of memory of 100 MB or lower. 3957 3958 Upon startup and reconfiguration, caches with a limited size 3959 preallocate a small amount of memory (less than 1% of 3960 :any:`max-cache-size` for a given view). This preallocation serves as an 3961 optimization to eliminate extra latency introduced by resizing 3962 internal cache structures. 3963 3964 On systems where detection of the amount of physical memory is not 3965 supported, percentage-based values fall back to ``unlimited``. Note 3966 that the amount of physical memory available is only detected on 3967 startup, so :iscman:`named` does not adjust the cache size limits if the 3968 amount of physical memory is changed at runtime. 3969 3970 .. namedconf:statement:: tcp-listen-queue 3971 :tags: server 3972 :short: Sets the listen-queue depth. 3973 3974 This sets the listen-queue depth. The default and minimum is 10. If the kernel 3975 supports the accept filter "dataready", this also controls how many 3976 TCP connections are queued in kernel space waiting for some 3977 data before being passed to accept. Non-zero values less than 10 are 3978 silently raised. A value of 0 may also be used; on most platforms 3979 this sets the listen-queue length to a system-defined default value. 3980 3981 .. namedconf:statement:: tcp-initial-timeout 3982 :tags: server, query 3983 :short: Sets the amount of time (in milliseconds) that the server waits on a new TCP connection for the first message from the client. 3984 3985 This sets the amount of time, in units of 100 milliseconds, that the server waits on 3986 a new TCP connection for the first message from the client. The 3987 default is 300 (30 seconds), the minimum is 25 (2.5 seconds), and the 3988 maximum is 1200 (two minutes). Values above the maximum or below the 3989 minimum are adjusted with a logged warning. (Note: this value 3990 must be greater than the expected round-trip delay time; otherwise, no 3991 client will ever have enough time to submit a message.) This value 3992 can be updated at runtime by using :option:`rndc tcp-timeouts`. 3993 3994 .. namedconf:statement:: tcp-idle-timeout 3995 :tags: query 3996 :short: Sets the amount of time (in milliseconds) that the server waits on an idle TCP connection before closing it, if the EDNS TCP keepalive option is not in use. 3997 3998 This sets the amount of time, in units of 100 milliseconds, that the server waits on 3999 an idle TCP connection before closing it, when the client is not using 4000 the EDNS TCP keepalive option. The default is 300 (30 seconds), the 4001 maximum is 1200 (two minutes), and the minimum is 1 (one-tenth of a 4002 second). Values above the maximum or below the minimum are 4003 adjusted with a logged warning. See :any:`tcp-keepalive-timeout` for 4004 clients using the EDNS TCP keepalive option. This value can be 4005 updated at runtime by using :option:`rndc tcp-timeouts`. 4006 4007 .. namedconf:statement:: tcp-keepalive-timeout 4008 :tags: query 4009 :short: Sets the amount of time (in milliseconds) that the server waits on an idle TCP connection before closing it, if the EDNS TCP keepalive option is in use. 4010 4011 This sets the amount of time, in units of 100 milliseconds, that the server waits on 4012 an idle TCP connection before closing it, when the client is using the 4013 EDNS TCP keepalive option. The default is 300 (30 seconds), the 4014 maximum is 65535 (about 1.8 hours), and the minimum is 1 (one-tenth 4015 of a second). Values above the maximum or below the minimum are 4016 adjusted with a logged warning. This value may be greater than 4017 :any:`tcp-idle-timeout` because clients using the EDNS TCP keepalive 4018 option are expected to use TCP connections for more than one message. 4019 This value can be updated at runtime by using :option:`rndc tcp-timeouts`. 4020 4021 .. namedconf:statement:: tcp-advertised-timeout 4022 :tags: query 4023 :short: Sets the timeout value (in milliseconds) that the server sends in responses containing the EDNS TCP keepalive option. 4024 4025 This sets the timeout value, in units of 100 milliseconds, that the server sends 4026 in responses containing the EDNS TCP keepalive option, which informs a 4027 client of the amount of time it may keep the session open. The 4028 default is 300 (30 seconds), the maximum is 65535 (about 1.8 hours), 4029 and the minimum is 0, which signals that the clients must close TCP 4030 connections immediately. Ordinarily this should be set to the same 4031 value as :any:`tcp-keepalive-timeout`. This value can be updated at 4032 runtime by using :option:`rndc tcp-timeouts`. 4033 4034 .. namedconf:statement:: update-quota 4035 :tags: server 4036 :short: Specifies the maximum number of concurrent DNS UPDATE messages that can be processed by the server. 4037 4038 This is the maximum number of simultaneous DNS UPDATE messages that 4039 the server will accept, for updating local authoritative zones or 4040 forwarding to a primary server. The default is ``100``. 4041 4042 .. namedconf:statement:: sig0checks-quota 4043 :tags: server 4044 :short: Specifies the maximum number of concurrent SIG(0) signature checks that can be processed by the server. 4045 4046 This is the maximum number of simultaneous SIG(0)-signed messages that 4047 the server accepts. If the quota is reached, then :iscman:`named` answers 4048 with a status code of REFUSED. The value of ``0`` disables the quota. The 4049 default is ``1``. 4050 4051 .. namedconf:statement:: sig0checks-quota-exempt 4052 :tags: server 4053 :short: Exempts specific clients or client groups from SIG(0) signature checking quota. 4054 4055 DNS clients can be exempted from the SIG(0) signature checking quota with the 4056 :any:`sig0checks-quota-exempt` clause, using their IP and/or network 4057 addresses. The default value is an empty list. 4058 4059 Example: 4060 4061 :: 4062 4063 sig0checks-quota-exempt { 4064 10.0.0.0/8; 4065 2001:db8::100; 4066 }; 4067 4068 .. namedconf:statement:: sig0key-checks-limit 4069 :tags: server 4070 :short: Specifies the maximum number of SIG(0) keys to consider when trying to verify a message. 4071 4072 This is the maximum number of keys to consider for a SIG(0)-signed message 4073 when trying to verify it. :iscman:`named` will parse the candidate keys and 4074 check whether their key tag and algorithm matches with the expected one 4075 before trying to verify the signature. If the limit is reached the message 4076 verification fails. The value of ``0`` disables the limitation. The default 4077 is ``16``. 4078 4079 .. namedconf:statement:: sig0message-checks-limit 4080 :tags: server 4081 :short: Specifies the maximum number of matching SIG(0) keys to try to verify a message. 4082 4083 This is the maximum number of keys which (when correctly parsed and matched 4084 against the expected key tag and algorithm) :iscman:`named` uses to verify 4085 a SIG(0)-signed message. If the limit is reached the message verification 4086 fails. The value of ``0`` disables the limitation. The default is ``2``. 4087 4088 .. _intervals: 4089 4090 Periodic Task Intervals 4091 ^^^^^^^^^^^^^^^^^^^^^^^ 4092 4093 .. namedconf:statement:: heartbeat-interval 4094 :tags: deprecated 4095 :short: Sets the interval at which the server performs zone maintenance tasks for all zones marked as :any:`dialup`. 4096 4097 The server performs zone maintenance tasks for all zones marked 4098 as :any:`dialup` whenever this interval expires. The default is 60 4099 minutes. Reasonable values are up to 1 day (1440 minutes). The 4100 maximum value is 28 days (40320 minutes). If set to 0, no zone 4101 maintenance for these zones occurs. 4102 4103 This option is deprecated and will be removed in a future release. 4104 4105 .. namedconf:statement:: interface-interval 4106 :tags: server 4107 :short: Sets the interval at which the server scans the network interface list. 4108 4109 The server scans the network interface list on every interval as specified by 4110 :any:`interface-interval`. 4111 4112 If set to 0, interface scanning only occurs when the configuration 4113 file is loaded, or when :any:`automatic-interface-scan` is enabled and supported 4114 by the operating system. After the scan, the server begins listening for 4115 queries on any newly discovered interfaces (provided they are allowed by the 4116 :any:`listen-on` configuration), and stops listening on interfaces that have 4117 gone away. For convenience, TTL-style time-unit suffixes may be used to 4118 specify the value. It also accepts ISO 8601 duration formats. 4119 4120 The default is 60 minutes (1 hour); the maximum value is 28 days. 4121 4122 The :any:`sortlist` Statement 4123 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4124 4125 The response to a DNS query may consist of multiple resource records 4126 (RRs) forming a resource record set (RRset). The name server 4127 normally returns the RRs within the RRset in an indeterminate order (but 4128 see the :any:`rrset-order` statement in :ref:`rrset_ordering`). The client resolver code should 4129 rearrange the RRs as appropriate: that is, using any addresses on the 4130 local net in preference to other addresses. However, not all resolvers 4131 can do this or are correctly configured. When a client is using a local 4132 server, the sorting can be performed in the server, based on the 4133 client's address. This only requires configuring the name servers, not 4134 all the clients. 4135 4136 .. namedconf:statement:: sortlist 4137 :tags: query, deprecated 4138 :short: Controls the ordering of RRs returned to the client, based on the client's IP address. 4139 4140 This option is deprecated and will be removed in a future release. 4141 4142 The :any:`sortlist` statement (see below) takes an :term:`address_match_list` and 4143 interprets it in a special way. Each top-level statement in the :any:`sortlist` 4144 must itself be an explicit :term:`address_match_list` with one or two elements. The 4145 first element (which may be an IP address, an IP prefix, an ACL name, or a nested 4146 :term:`address_match_list`) of each top-level list is checked against the source 4147 address of the query until a match is found. When the addresses in the first 4148 element overlap, the first rule to match is selected. 4149 4150 Once the source address of the query has been matched, if the top-level 4151 statement contains only one element, the actual primitive element that 4152 matched the source address is used to select the address in the response 4153 to move to the beginning of the response. If the statement is a list of 4154 two elements, then the second element is interpreted as a topology 4155 preference list. Each top-level element is assigned a distance, and the 4156 address in the response with the minimum distance is moved to the 4157 beginning of the response. 4158 4159 In the following example, any queries received from any of the addresses 4160 of the host itself get responses preferring addresses on any of the 4161 locally connected networks. Next most preferred are addresses on the 4162 192.168.1/24 network, and after that either the 192.168.2/24 or 4163 192.168.3/24 network, with no preference shown between these two 4164 networks. Queries received from a host on the 192.168.1/24 network 4165 prefer other addresses on that network to the 192.168.2/24 and 4166 192.168.3/24 networks. Queries received from a host on the 192.168.4/24 4167 or the 192.168.5/24 network only prefer other addresses on their 4168 directly connected networks. 4169 4170 :: 4171 4172 sortlist { 4173 // IF the local host 4174 // THEN first fit on the following nets 4175 { localhost; 4176 { localnets; 4177 192.168.1/24; 4178 { 192.168.2/24; 192.168.3/24; }; }; }; 4179 // IF on class C 192.168.1 THEN use .1, or .2 or .3 4180 { 192.168.1/24; 4181 { 192.168.1/24; 4182 { 192.168.2/24; 192.168.3/24; }; }; }; 4183 // IF on class C 192.168.2 THEN use .2, or .1 or .3 4184 { 192.168.2/24; 4185 { 192.168.2/24; 4186 { 192.168.1/24; 192.168.3/24; }; }; }; 4187 // IF on class C 192.168.3 THEN use .3, or .1 or .2 4188 { 192.168.3/24; 4189 { 192.168.3/24; 4190 { 192.168.1/24; 192.168.2/24; }; }; }; 4191 // IF .4 or .5 THEN prefer that net 4192 { { 192.168.4/24; 192.168.5/24; }; 4193 }; 4194 }; 4195 4196 The following example illustrates reasonable behavior for the local host 4197 and hosts on directly connected networks. Responses sent to queries from the 4198 local host favor any of the directly connected networks. Responses 4199 sent to queries from any other hosts on a directly connected network 4200 prefer addresses on that same network. Responses to other queries 4201 are not sorted. 4202 4203 :: 4204 4205 sortlist { 4206 { localhost; localnets; }; 4207 { localnets; }; 4208 }; 4209 4210 .. _rrset_ordering: 4211 4212 RRset Ordering 4213 ^^^^^^^^^^^^^^ 4214 4215 .. note:: 4216 4217 While alternating the order of records in a DNS response between 4218 subsequent queries is a known load distribution technique, certain 4219 caveats apply (mostly stemming from caching) which usually make it a 4220 suboptimal choice for load balancing purposes when used on its own. 4221 4222 .. namedconf:statement:: rrset-order 4223 :tags: query 4224 :short: Defines the order in which equal RRs (RRsets) are returned. 4225 4226 The :any:`rrset-order` statement permits configuration of the ordering of 4227 the records in a multiple-record response. See also: 4228 :any:`sortlist`. 4229 4230 Each rule in an :any:`rrset-order` statement is defined as follows: 4231 4232 :: 4233 4234 [class <class_name>] [type <type_name>] [name "<domain_name>"] order <ordering> 4235 4236 The default qualifiers for each rule are: 4237 4238 - If no ``class`` is specified, the default is ``ANY``. 4239 - If no :any:`type` is specified, the default is ``ANY``. 4240 - If no ``name`` is specified, the default is ``*`` (asterisk). 4241 4242 :term:`<domain_name> <domain_name>` only matches the name itself, not any of its 4243 subdomains. To make a rule match all subdomains of a given name, a 4244 wildcard name (``*.<domain_name>``) must be used. Note that 4245 ``*.<domain_name>`` does *not* match ``<domain_name>`` itself; to 4246 specify RRset ordering for a name and all of its subdomains, two 4247 separate rules must be defined: one for ``<domain_name>`` and one for 4248 ``*.<domain_name>``. 4249 4250 The legal values for ``<ordering>`` are: 4251 4252 ``fixed`` 4253 Records are returned in the order they are defined in the zone file. 4254 4255 This value is deprecated and will be removed in a future release. 4256 4257 .. note:: 4258 4259 The ``fixed`` option is only available if BIND is configured with 4260 ``--enable-fixed-rrset`` at compile time. 4261 4262 ``random`` 4263 Records are returned in a non-deterministic order. The random ordering 4264 doesn't guarantee uniform distribution of all permutations. 4265 4266 ``cyclic`` 4267 Records are returned in a cyclic round-robin order, rotating by one 4268 record per query. 4269 4270 ``none`` 4271 Records are returned in the order they were retrieved from the 4272 database. This order is indeterminate, but remains consistent as 4273 long as the database is not modified. 4274 4275 The default RRset order used depends on whether any :any:`rrset-order` 4276 statements are present in the configuration file used by :iscman:`named`: 4277 4278 - If no :any:`rrset-order` statement is present in the configuration 4279 file, the implicit default is to return all records in ``random`` 4280 order. 4281 4282 - If any :any:`rrset-order` statements are present in the configuration 4283 file, but no ordering rule specified in these statements matches a 4284 given RRset, the default order for that RRset is ``none``. 4285 4286 Note that if multiple :any:`rrset-order` statements are present in the 4287 configuration file (at both the :namedconf:ref:`options` and :any:`view` levels), they 4288 are *not* combined; instead, the more-specific one (:any:`view`) replaces 4289 the less-specific one (:namedconf:ref:`options`). 4290 4291 If multiple rules within a single :any:`rrset-order` statement match a 4292 given RRset, the first matching rule is applied. 4293 4294 Example: 4295 4296 :: 4297 4298 rrset-order { 4299 type A name "foo.isc.org" order random; 4300 type AAAA name "foo.isc.org" order cyclic; 4301 name "bar.isc.org" order fixed; 4302 name "*.bar.isc.org" order random; 4303 name "*.baz.isc.org" order cyclic; 4304 }; 4305 4306 With the above configuration, the following RRset ordering is used: 4307 4308 =================== ======== =========== 4309 QNAME QTYPE RRset Order 4310 =================== ======== =========== 4311 ``foo.isc.org`` ``A`` ``random`` 4312 ``foo.isc.org`` ``AAAA`` ``cyclic`` 4313 ``foo.isc.org`` ``TXT`` ``none`` 4314 ``sub.foo.isc.org`` all ``none`` 4315 ``bar.isc.org`` all ``fixed`` 4316 ``sub.bar.isc.org`` all ``random`` 4317 ``baz.isc.org`` all ``none`` 4318 ``sub.baz.isc.org`` all ``cyclic`` 4319 =================== ======== =========== 4320 4321 .. _tuning: 4322 4323 Tuning 4324 ^^^^^^ 4325 4326 .. namedconf:statement:: lame-ttl 4327 :tags: server 4328 :short: Sets the resolver's lame cache. 4329 4330 This is always set to 0. More information is available in the 4331 `security advisory for CVE-2021-25219 4332 <https://kb.isc.org/docs/cve-2021-25219>`_. 4333 4334 .. namedconf:statement:: servfail-ttl 4335 :tags: server 4336 :short: Sets the length of time (in seconds) that a SERVFAIL response is cached. 4337 4338 This sets the number of seconds to cache a SERVFAIL response due to DNSSEC 4339 validation failure or other general server failure. If set to ``0``, 4340 SERVFAIL caching is disabled. The SERVFAIL cache is not consulted if 4341 a query has the CD (Checking Disabled) bit set; this allows a query 4342 that failed due to DNSSEC validation to be retried without waiting 4343 for the SERVFAIL TTL to expire. 4344 4345 The maximum value is ``30`` seconds; any higher value is 4346 silently reduced. The default is ``1`` second. 4347 4348 .. namedconf:statement:: min-ncache-ttl 4349 :tags: server 4350 :short: Specifies the minimum retention time (in seconds) for storage of negative answers in the server's cache. 4351 4352 To reduce network traffic and increase performance, the server stores 4353 negative answers. :any:`min-ncache-ttl` is used to set a minimum 4354 retention time for these answers in the server, in seconds. For 4355 convenience, TTL-style time-unit suffixes may be used to specify the 4356 value. It also accepts ISO 8601 duration formats. 4357 4358 The default :any:`min-ncache-ttl` is ``0`` seconds. :any:`min-ncache-ttl` cannot 4359 exceed 90 seconds and is truncated to 90 seconds if set to a greater 4360 value. 4361 4362 .. namedconf:statement:: min-cache-ttl 4363 :tags: server 4364 :short: Specifies the minimum time (in seconds) that the server caches ordinary (positive) answers. 4365 4366 This sets the minimum time for which the server caches ordinary (positive) 4367 answers, in seconds. For convenience, TTL-style time-unit suffixes may be used 4368 to specify the value. It also accepts ISO 8601 duration formats. 4369 4370 The default :any:`min-cache-ttl` is ``0`` seconds. :any:`min-cache-ttl` cannot 4371 exceed 90 seconds and is truncated to 90 seconds if set to a greater 4372 value. 4373 4374 .. namedconf:statement:: max-ncache-ttl 4375 :tags: server 4376 :short: Specifies the maximum retention time (in seconds) for storage of negative answers in the server's cache. 4377 4378 To reduce network traffic and increase performance, the server stores 4379 negative answers. :any:`max-ncache-ttl` is used to set a maximum retention time 4380 for these answers in the server, in seconds. For convenience, TTL-style 4381 time-unit suffixes may be used to specify the value. It also accepts ISO 8601 4382 duration formats. 4383 4384 The default :any:`max-ncache-ttl` is 10800 seconds (3 hours). :any:`max-ncache-ttl` 4385 cannot exceed 7 days and is silently truncated to 7 days if set to a 4386 greater value. 4387 4388 .. namedconf:statement:: max-cache-ttl 4389 :tags: server 4390 :short: Specifies the maximum time (in seconds) that the server caches ordinary (positive) answers. 4391 4392 This sets the maximum time for which the server caches ordinary (positive) 4393 answers, in seconds. For convenience, TTL-style time-unit suffixes may be used 4394 to specify the value. It also accepts ISO 8601 duration formats. 4395 4396 The default :any:`max-cache-ttl` is 604800 (one week). A value of zero may cause 4397 all queries to return SERVFAIL, because of lost caches of intermediate RRsets 4398 (such as NS and glue AAAA/A records) in the resolution process. 4399 4400 .. namedconf:statement:: max-stale-ttl 4401 :tags: server 4402 :short: Specifies the maximum time that the server retains records past their normal expiry, to return them as stale records. 4403 4404 If retaining stale RRsets in cache is enabled, and returning of stale cached 4405 answers is also enabled, :any:`max-stale-ttl` sets the maximum time for which 4406 the server retains records past their normal expiry to return them as stale 4407 records, when the servers for those records are not reachable. The default 4408 is 1 day. The minimum allowed is 1 second; a value of 0 is updated silently 4409 to 1 second. 4410 4411 For stale answers to be returned, the retaining of them in cache must be 4412 enabled via the configuration option :any:`stale-cache-enable`, and returning 4413 cached answers must be enabled, either in the configuration file using the 4414 :any:`stale-answer-enable` option or by calling :option:`rndc serve-stale on <rndc serve-stale>`. 4415 4416 When :any:`stale-cache-enable` is set to ``no``, setting the :any:`max-stale-ttl` 4417 has no effect; the value of :any:`max-stale-ttl` is ``0`` in such a case. 4418 4419 .. namedconf:statement:: sig-validity-interval 4420 :tags: obsolete 4421 4422 This option no longer has any effect. 4423 4424 .. namedconf:statement:: dnskey-sig-validity 4425 :tags: obsolete 4426 4427 This option no longer has any effect. 4428 4429 .. namedconf:statement:: sig-signing-nodes 4430 :tags: dnssec 4431 :short: Specifies the maximum number of nodes to be examined in each quantum, when signing a zone with a new DNSKEY. 4432 4433 The default is ``100``. 4434 4435 .. namedconf:statement:: sig-signing-signatures 4436 :tags: dnssec 4437 :short: Specifies the threshold for the number of signatures that terminates processing a quantum, when signing a zone with a new DNSKEY. 4438 4439 The default is ``10``. 4440 4441 .. namedconf:statement:: sig-signing-type 4442 :tags: dnssec 4443 :short: Specifies a private RDATA type to use when generating signing-state records. 4444 4445 The default is ``65534``. 4446 4447 This parameter may be removed in a future version, once there is a standard 4448 type. 4449 4450 Signing-state records are used internally by :iscman:`named` to track 4451 the current state of a zone-signing process, i.e., whether it is 4452 still active or has been completed. The records can be inspected 4453 using the command :option:`rndc signing -list zone <rndc signing>`. 4454 Once :iscman:`named` has finished signing a zone with a particular key, 4455 the signing-state record associated with that key can be removed from the 4456 zone by running 4457 :option:`rndc signing -clear keyid/algorithm zone <rndc signing>`. 4458 To clear all of the completed signing-state records for a zone, use 4459 :option:`rndc signing -clear all zone <rndc signing>`. 4460 4461 .. namedconf:statement:: min-refresh-time 4462 :tags: transfer 4463 :short: Limits the zone refresh interval to no more often than the specified value, in seconds. 4464 4465 This option controls the server's behavior on refreshing a zone 4466 (querying for SOA changes). Usually, the SOA refresh values for 4467 the zone are used; however, these values are set by the primary, giving 4468 secondary server administrators little control over their contents. 4469 4470 This option allows the administrator to set a minimum 4471 refresh time in seconds per-zone, per-view, or globally. 4472 This option is valid for secondary and stub zones, and clamps the SOA 4473 refresh time to the specified value. 4474 4475 The default is 300 seconds. 4476 4477 .. namedconf:statement:: max-refresh-time 4478 :tags: transfer 4479 :short: Limits the zone refresh interval to no less often than the specified value, in seconds. 4480 4481 This option controls the server's behavior on refreshing a zone 4482 (querying for SOA changes). Usually, the SOA refresh values for 4483 the zone are used; however, these values are set by the primary, giving 4484 secondary server administrators little control over their contents. 4485 4486 This option allows the administrator to set a maximum 4487 refresh time in seconds per-zone, per-view, or globally. 4488 This option is valid for secondary and stub zones, and clamps the SOA 4489 refresh time to the specified value. 4490 4491 The default is 2419200 seconds (4 weeks). 4492 4493 .. namedconf:statement:: min-retry-time 4494 :tags: transfer 4495 :short: Limits the zone refresh retry interval to no more often than the specified value, in seconds. 4496 4497 This option controls the server's behavior on retrying failed 4498 zone transfers. Usually, the SOA retry values for the zone are 4499 used; however, these values are set by the primary, giving 4500 secondary server administrators little control over their contents. 4501 4502 This option allows the administrator to set a minimum 4503 retry time in seconds per-zone, per-view, or globally. 4504 This option is valid for secondary and stub zones, and clamps the SOA 4505 retry time to the specified value. 4506 4507 The default is 500 seconds. 4508 4509 .. namedconf:statement:: max-retry-time 4510 :tags: transfer 4511 :short: Limits the zone refresh retry interval to no less often than the specified value, in seconds. 4512 4513 This option controls the server's behavior on retrying failed 4514 zone transfers. Usually, the SOA retry values for the zone are 4515 used; however, these values are set by the primary, giving 4516 secondary server administrators little control over their contents. 4517 4518 This option allows the administrator to set a maximum 4519 retry time in seconds per-zone, per-view, or globally. 4520 This option is valid for secondary and stub zones, and clamps the SOA 4521 retry time to the specified value. 4522 4523 The default is 1209600 seconds (2 weeks). 4524 4525 .. namedconf:statement:: edns-udp-size 4526 :tags: query 4527 :short: Sets the maximum advertised EDNS UDP buffer size to control the size of packets received from authoritative servers in response to recursive queries. 4528 4529 This sets the maximum advertised EDNS UDP buffer size, in bytes, to control 4530 the size of packets received from authoritative servers in response 4531 to recursive queries. Valid values are 512 to 4096; values outside 4532 this range are silently adjusted to the nearest value within it. 4533 The default value is 1232. 4534 4535 The usual reason for setting :any:`edns-udp-size` to a non-default value 4536 is to get UDP answers to pass through broken firewalls that block 4537 fragmented packets and/or block UDP DNS packets that are greater than 4538 512 bytes. 4539 4540 When :iscman:`named` first queries a remote server, it advertises a UDP 4541 buffer size of 1232. 4542 4543 Query timeouts observed for any given server affect the buffer size 4544 advertised in queries sent to that server. Depending on observed packet 4545 dropping patterns, the query is retried over TCP. Per-server EDNS statistics 4546 are only retained in memory for the lifetime of a given server's ADB entry. 4547 4548 According to measurements taken by multiple parties, the default value 4549 should not be causing the fragmentation. As most of the Internet "core" is able to 4550 cope with IP message sizes between 1400-1500 bytes, the 1232 size was chosen 4551 as a conservative minimal number that could be changed by the DNS operator to 4552 a estimated path MTU, minus the estimated header space. In practice, the 4553 smallest MTU witnessed in the operational DNS community is 1500 octets, the 4554 Ethernet maximum payload size, so a useful default for the maximum DNS/UDP 4555 payload size on **reliable** networks would be 1432. 4556 4557 Any server-specific :any:`edns-udp-size` setting has precedence over all 4558 the above rules, i.e. configures a static value for a given 4559 :namedconf:ref:`server` block. 4560 4561 .. namedconf:statement:: max-udp-size 4562 :tags: query 4563 :short: Sets the maximum EDNS UDP message size sent by :iscman:`named`. 4564 4565 This sets the maximum EDNS UDP message size that :iscman:`named` sends, in bytes. 4566 Valid values are 512 to 4096; values outside this range are 4567 silently adjusted to the nearest value within it. The default value 4568 is 1232. 4569 4570 This value applies to responses sent by a server; to set the 4571 advertised buffer size in queries, see :any:`edns-udp-size`. 4572 4573 The usual reason for setting :any:`max-udp-size` to a non-default value 4574 is to allow UDP answers to pass through broken firewalls that block 4575 fragmented packets and/or block UDP packets that are greater than 512 4576 bytes. This is independent of the advertised receive buffer 4577 (:any:`edns-udp-size`). 4578 4579 Setting this to a low value encourages additional TCP traffic to 4580 the name server. 4581 4582 .. namedconf:statement:: masterfile-format 4583 :tags: zone, server 4584 :short: Specifies the file format of zone files. 4585 4586 This specifies the file format of zone files (see :ref:`zonefile_format` 4587 for details). The default value is ``text``, which is the standard 4588 textual representation, except for secondary zones, in which the default 4589 value is ``raw``. Files in formats other than ``text`` are typically 4590 expected to be generated by the :iscman:`named-compilezone` tool, or dumped by 4591 :iscman:`named`. 4592 4593 Note that when a zone file in a format other than ``text`` is loaded, 4594 :iscman:`named` may omit some of the checks which are performed for a file in 4595 ``text`` format. For example, :any:`check-names` only applies when loading 4596 zones in ``text`` format. Zone files in ``raw`` format should be generated 4597 with the same check level as that specified in the :iscman:`named` 4598 configuration file. 4599 4600 When configured in :namedconf:ref:`options`, this statement sets the 4601 :any:`masterfile-format` for all zones, but it can be overridden on a 4602 per-zone or per-view basis by including a :any:`masterfile-format` 4603 statement within the :any:`zone` or :any:`view` block in the configuration 4604 file. 4605 4606 .. namedconf:statement:: masterfile-style 4607 :tags: server 4608 :short: Specifies the format of zone files during a dump, when the :any:`masterfile-format` is ``text``. 4609 4610 This specifies the formatting of zone files during dump, when the 4611 :any:`masterfile-format` is ``text``. This option is ignored with any 4612 other :any:`masterfile-format`. 4613 4614 When set to ``relative``, records are printed in a multi-line format, 4615 with owner names expressed relative to a shared origin. When set to 4616 ``full``, records are printed in a single-line format with absolute 4617 owner names. The ``full`` format is most suitable when a zone file 4618 needs to be processed automatically by a script. The ``relative`` 4619 format is more human-readable, and is thus suitable when a zone is to 4620 be edited by hand. The default is ``relative``. 4621 4622 .. namedconf:statement:: max-query-count 4623 :tags: server, query 4624 :short: Sets the maximum number of iterative queries while servicing a recursive query. 4625 4626 This sets the maximum number of iterative queries that may be sent 4627 by a resolver while looking up a single name. If more queries than this 4628 need to be sent before an answer is reached, then recursion is terminated 4629 and a SERVFAIL response is returned to the client. The default is ``200``. 4630 4631 .. namedconf:statement:: max-recursion-depth 4632 :tags: server 4633 :short: Sets the maximum number of levels of recursion permitted at any one time while servicing a recursive query. 4634 4635 This sets the maximum number of levels of recursion that are permitted at 4636 any one time while servicing a recursive query. Resolving a name may 4637 require looking up a name server address, which in turn requires 4638 resolving another name, etc.; if the number of recursions exceeds 4639 this value, the recursive query is terminated and returns SERVFAIL. 4640 The default is 7. 4641 4642 .. namedconf:statement:: max-recursion-queries 4643 :tags: server, query 4644 :short: Sets the maximum number of iterative queries while servicing a recursive query. 4645 4646 This sets the maximum number of iterative queries that may be sent 4647 by a resolver while looking up a single name. If more queries than this 4648 need to be sent before an answer is reached, then recursion is terminated 4649 and a SERVFAIL response is returned to the client. (Note: if the answer 4650 is a CNAME, then the subsequent lookup for the target of the CNAME is 4651 counted separately.) The default is 50. 4652 4653 .. namedconf:statement:: max-query-restarts 4654 :tags: server, query 4655 :short: Sets the maximum number of chained CNAMEs to follow 4656 4657 This sets the maximum number of successive CNAME targets to follow 4658 when resolving a client query, before terminating the query to avoid a 4659 CNAME loop. Valid values are 1 to 255. The default is 11. 4660 4661 .. namedconf:statement:: notify-defer 4662 :tags: transfer, zone 4663 :short: Sets the defer time (in seconds) before sending NOTIFY messages for a zone. 4664 4665 This sets the delay, in seconds, to wait before sending a set of NOTIFY 4666 messages for a zone. Whenever a NOTIFY message is ready to be sent, sending 4667 will be deferred for this duration. This can be useful, for example, when 4668 for some operation needs a catalog zone is updated with new member zones 4669 before these member zones are actually ready to be tranferred. The delay can 4670 be tuned for the catalog zone to an amount of time after which the member 4671 zones are usually known to become ready. The default is 0 seconds. 4672 4673 .. warning:: 4674 This option is not to be confused with the :any:`notify-delay` option. 4675 4676 .. note:: 4677 An implicit :option:`rndc notify` command for a zone overrides the 4678 effects of this option. 4679 4680 .. note:: 4681 This options is ignored for notifies sent during the :any:`dialup` 4682 process. 4683 4684 .. namedconf:statement:: notify-delay 4685 :tags: transfer, zone 4686 :short: Sets the delay (in seconds) between sending sets of NOTIFY messages for a zone. 4687 4688 This sets the delay, in seconds, between sending sets of NOTIFY messages 4689 for a zone. Whenever a NOTIFY message is sent for a zone, a timer will 4690 be set for this duration. If the zone is updated again before the timer 4691 expires, the NOTIFY for that update will be postponed. The default is 5 4692 seconds. 4693 4694 The overall rate at which NOTIFY messages are sent for all zones is 4695 controlled by :any:`notify-rate`. 4696 4697 .. warning:: 4698 This option is not to be confused with the :any:`notify-defer` option. 4699 4700 .. namedconf:statement:: max-rsa-exponent-size 4701 :tags: dnssec, query 4702 :short: Sets the maximum RSA exponent size (in bits) when validating. 4703 4704 This sets the maximum RSA exponent size, in bits, that is accepted when 4705 validating. Valid values are 35 to 4096 bits. The default, zero, is 4706 also accepted and is equivalent to 4096. 4707 4708 .. namedconf:statement:: prefetch 4709 :tags: query 4710 :short: Specifies the "trigger" time-to-live (TTL) value at which prefetch of the current query takes place. 4711 4712 When a query is received for cached data which is to expire shortly, 4713 :iscman:`named` can refresh the data from the authoritative server 4714 immediately, ensuring that the cache always has an answer available. 4715 4716 :any:`prefetch` specifies the "trigger" TTL value at which prefetch 4717 of the current query takes place; when a cache record with an 4718 equal or lower TTL value is encountered during query processing, it is 4719 refreshed. Valid trigger TTL values are 1 to 10 seconds. Values 4720 larger than 10 seconds are silently reduced to 10. Setting a 4721 trigger TTL to zero causes prefetch to be disabled. The default 4722 trigger TTL is ``2``. 4723 4724 An optional second argument specifies the "eligibility" TTL: the 4725 smallest *original* TTL value that is accepted for a record to 4726 be eligible for prefetching. The eligibility TTL must be at least six 4727 seconds longer than the trigger TTL; if not, :iscman:`named` 4728 silently adjusts it upward. The default eligibility TTL is ``9``. 4729 4730 .. namedconf:statement:: v6-bias 4731 :tags: server, query 4732 :short: Indicates the number of milliseconds of preference to give to IPv6 name servers. 4733 4734 When determining the next name server to try, this indicates by how many 4735 milliseconds to prefer IPv6 name servers. The default is ``50`` 4736 milliseconds. 4737 4738 .. namedconf:statement:: tcp-receive-buffer 4739 :tags: server 4740 :short: Sets the operating system's receive buffer size for TCP sockets. 4741 4742 .. namedconf:statement:: udp-receive-buffer 4743 :tags: server 4744 :short: Sets the operating system's receive buffer size for UDP sockets. 4745 4746 These options control the operating system's receive buffer sizes 4747 (``SO_RCVBUF``) for TCP and UDP sockets, respectively. Buffering at 4748 the operating system level can prevent packet drops during brief load 4749 spikes, but if the buffer size is set too high, a running server 4750 could get clogged with outstanding queries that have already timed 4751 out. The default is ``0``, which means the operating system's default 4752 value should be used. The minimum configurable value is ``4096``; any 4753 nonzero value lower than that is silently raised. The maximum value 4754 is determined by the kernel, and values exceeding the maximum are 4755 silently reduced. 4756 4757 .. namedconf:statement:: tcp-send-buffer 4758 :tags: server 4759 :short: Sets the operating system's send buffer size for TCP sockets. 4760 4761 .. namedconf:statement:: udp-send-buffer 4762 :tags: server 4763 :short: Sets the operating system's send buffer size for UDP sockets. 4764 4765 These options control the operating system's send buffer sizes 4766 (``SO_SNDBUF``) for TCP and UDP sockets, respectively. Buffering at 4767 the operating system level can prevent packet drops during brief load 4768 spikes, but if the buffer size is set too high, a running server 4769 could get clogged with outstanding queries that have already timed 4770 out. The default is ``0``, which means the operating system's default 4771 value should be used. The minimum configurable value is ``4096``; any 4772 nonzero value lower than that is silently raised. The maximum value 4773 is determined by the kernel, and values exceeding the maximum are 4774 silently reduced. 4775 4776 .. _builtin: 4777 4778 Built-in Server Information Zones 4779 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4780 4781 The server provides some helpful diagnostic information through a number 4782 of built-in zones under the pseudo-top-level-domain ``bind`` in the 4783 ``CHAOS`` class. These zones are part of a built-in view 4784 (see :any:`view`) of class ``CHAOS``, which is 4785 separate from the default view of class ``IN``. Most global 4786 configuration options (:any:`allow-query`, etc.) apply to this view, 4787 but some are locally overridden: :namedconf:ref:`notify`, :any:`recursion`, and 4788 :any:`allow-new-zones` are always set to ``no``, and :any:`rate-limit` is set 4789 to allow three responses per second. 4790 4791 To disable these zones, use the options below or hide the 4792 built-in ``CHAOS`` view by defining an explicit view of class ``CHAOS`` 4793 that matches all clients. 4794 4795 .. namedconf:statement:: version 4796 :tags: server 4797 :short: Specifies the version number of the server to return in response to a ``version.bind`` query. 4798 4799 This is the version the server should report via a query of the name 4800 ``version.bind`` with type ``TXT`` and class ``CHAOS``. The default is 4801 the real version number of this server. Specifying ``version none`` 4802 disables processing of the queries. 4803 4804 Setting :any:`version` to any value (including ``none``) also disables 4805 queries for ``authors.bind TXT CH``. 4806 4807 .. namedconf:statement:: hostname 4808 :tags: server 4809 :short: Specifies the hostname of the server to return in response to a ``hostname.bind`` query. 4810 4811 This is the hostname the server should report via a query of the name 4812 ``hostname.bind`` with type ``TXT`` and class ``CHAOS``. This defaults 4813 to the hostname of the machine hosting the name server, as found by 4814 the ``gethostname()`` function. The primary purpose of such queries is to 4815 identify which of a group of anycast servers is actually answering 4816 the queries. Specifying ``hostname none;`` disables processing of 4817 the queries. 4818 4819 .. namedconf:statement:: server-id 4820 :tags: server 4821 :short: Specifies the ID of the server to return in response to a ``ID.SERVER`` query. 4822 4823 This is the ID the server should report when receiving a Name Server 4824 Identifier (NSID) query, or a query of the name ``ID.SERVER`` with 4825 type ``TXT`` and class ``CHAOS``. The primary purpose of such queries is 4826 to identify which of a group of anycast servers is actually answering 4827 the queries. Specifying ``server-id none;`` disables processing of 4828 the queries. Specifying ``server-id hostname;`` causes :iscman:`named` 4829 to use the hostname as found by the ``gethostname()`` function. The 4830 default :any:`server-id` is ``none``. 4831 4832 .. _empty: 4833 4834 Built-in Empty Zones 4835 ^^^^^^^^^^^^^^^^^^^^ 4836 4837 The :iscman:`named` server has some built-in empty zones, for SOA and NS records 4838 only. These are for zones that should normally be answered locally and for 4839 which queries should not be sent to the Internet's root servers. The 4840 official servers that cover these namespaces return NXDOMAIN responses 4841 to these queries. In particular, these cover the reverse namespaces for 4842 addresses from :rfc:`1918`, :rfc:`4193`, :rfc:`5737`, and :rfc:`6598`. They also 4843 include the reverse namespace for the IPv6 local address (locally assigned), 4844 IPv6 link local addresses, the IPv6 loopback address, and the IPv6 4845 unknown address. 4846 4847 The server attempts to determine whether a built-in zone already exists 4848 or is active (covered by a forward-only forwarding declaration), and does 4849 not create an empty zone if either is true. 4850 4851 The current list of empty zones is: 4852 4853 - 10.IN-ADDR.ARPA 4854 - 16.172.IN-ADDR.ARPA 4855 - 17.172.IN-ADDR.ARPA 4856 - 18.172.IN-ADDR.ARPA 4857 - 19.172.IN-ADDR.ARPA 4858 - 20.172.IN-ADDR.ARPA 4859 - 21.172.IN-ADDR.ARPA 4860 - 22.172.IN-ADDR.ARPA 4861 - 23.172.IN-ADDR.ARPA 4862 - 24.172.IN-ADDR.ARPA 4863 - 25.172.IN-ADDR.ARPA 4864 - 26.172.IN-ADDR.ARPA 4865 - 27.172.IN-ADDR.ARPA 4866 - 28.172.IN-ADDR.ARPA 4867 - 29.172.IN-ADDR.ARPA 4868 - 30.172.IN-ADDR.ARPA 4869 - 31.172.IN-ADDR.ARPA 4870 - 168.192.IN-ADDR.ARPA 4871 - 64.100.IN-ADDR.ARPA 4872 - 65.100.IN-ADDR.ARPA 4873 - 66.100.IN-ADDR.ARPA 4874 - 67.100.IN-ADDR.ARPA 4875 - 68.100.IN-ADDR.ARPA 4876 - 69.100.IN-ADDR.ARPA 4877 - 70.100.IN-ADDR.ARPA 4878 - 71.100.IN-ADDR.ARPA 4879 - 72.100.IN-ADDR.ARPA 4880 - 73.100.IN-ADDR.ARPA 4881 - 74.100.IN-ADDR.ARPA 4882 - 75.100.IN-ADDR.ARPA 4883 - 76.100.IN-ADDR.ARPA 4884 - 77.100.IN-ADDR.ARPA 4885 - 78.100.IN-ADDR.ARPA 4886 - 79.100.IN-ADDR.ARPA 4887 - 80.100.IN-ADDR.ARPA 4888 - 81.100.IN-ADDR.ARPA 4889 - 82.100.IN-ADDR.ARPA 4890 - 83.100.IN-ADDR.ARPA 4891 - 84.100.IN-ADDR.ARPA 4892 - 85.100.IN-ADDR.ARPA 4893 - 86.100.IN-ADDR.ARPA 4894 - 87.100.IN-ADDR.ARPA 4895 - 88.100.IN-ADDR.ARPA 4896 - 89.100.IN-ADDR.ARPA 4897 - 90.100.IN-ADDR.ARPA 4898 - 91.100.IN-ADDR.ARPA 4899 - 92.100.IN-ADDR.ARPA 4900 - 93.100.IN-ADDR.ARPA 4901 - 94.100.IN-ADDR.ARPA 4902 - 95.100.IN-ADDR.ARPA 4903 - 96.100.IN-ADDR.ARPA 4904 - 97.100.IN-ADDR.ARPA 4905 - 98.100.IN-ADDR.ARPA 4906 - 99.100.IN-ADDR.ARPA 4907 - 100.100.IN-ADDR.ARPA 4908 - 101.100.IN-ADDR.ARPA 4909 - 102.100.IN-ADDR.ARPA 4910 - 103.100.IN-ADDR.ARPA 4911 - 104.100.IN-ADDR.ARPA 4912 - 105.100.IN-ADDR.ARPA 4913 - 106.100.IN-ADDR.ARPA 4914 - 107.100.IN-ADDR.ARPA 4915 - 108.100.IN-ADDR.ARPA 4916 - 109.100.IN-ADDR.ARPA 4917 - 110.100.IN-ADDR.ARPA 4918 - 111.100.IN-ADDR.ARPA 4919 - 112.100.IN-ADDR.ARPA 4920 - 113.100.IN-ADDR.ARPA 4921 - 114.100.IN-ADDR.ARPA 4922 - 115.100.IN-ADDR.ARPA 4923 - 116.100.IN-ADDR.ARPA 4924 - 117.100.IN-ADDR.ARPA 4925 - 118.100.IN-ADDR.ARPA 4926 - 119.100.IN-ADDR.ARPA 4927 - 120.100.IN-ADDR.ARPA 4928 - 121.100.IN-ADDR.ARPA 4929 - 122.100.IN-ADDR.ARPA 4930 - 123.100.IN-ADDR.ARPA 4931 - 124.100.IN-ADDR.ARPA 4932 - 125.100.IN-ADDR.ARPA 4933 - 126.100.IN-ADDR.ARPA 4934 - 127.100.IN-ADDR.ARPA 4935 - 0.IN-ADDR.ARPA 4936 - 127.IN-ADDR.ARPA 4937 - 254.169.IN-ADDR.ARPA 4938 - 2.0.192.IN-ADDR.ARPA 4939 - 100.51.198.IN-ADDR.ARPA 4940 - 113.0.203.IN-ADDR.ARPA 4941 - 255.255.255.255.IN-ADDR.ARPA 4942 - 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA 4943 - 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA 4944 - 8.B.D.0.1.0.0.2.IP6.ARPA 4945 - D.F.IP6.ARPA 4946 - 8.E.F.IP6.ARPA 4947 - 9.E.F.IP6.ARPA 4948 - A.E.F.IP6.ARPA 4949 - B.E.F.IP6.ARPA 4950 - EMPTY.AS112.ARPA 4951 - HOME.ARPA 4952 - RESOLVER.ARPA 4953 4954 Empty zones can be set at the view level and only apply to views of 4955 class IN. Disabled empty zones are only inherited from options if there 4956 are no disabled empty zones specified at the view level. To override the 4957 options list of disabled zones, disable the root zone at the 4958 view level. For example: 4959 4960 :: 4961 4962 disable-empty-zone "."; 4963 4964 If using the address ranges covered here, 4965 reverse zones covering the addresses should already be in place. In practice this 4966 appears to not be the case, with many queries being made to the 4967 infrastructure servers for names in these spaces. So many, in fact, that 4968 sacrificial servers had to be deployed to channel the query load 4969 away from the infrastructure servers. 4970 4971 .. note:: 4972 4973 The real parent servers for these zones should disable all empty zones 4974 under the parent zone they serve. For the real root servers, this is 4975 all built-in empty zones. This enables them to return referrals 4976 to deeper in the tree. 4977 4978 .. namedconf:statement:: empty-server 4979 :tags: server, zone 4980 :short: Specifies the server name in the returned SOA record for empty zones. 4981 4982 This specifies the server name that appears in the returned SOA record for 4983 empty zones. If none is specified, the zone's name is used. 4984 4985 .. namedconf:statement:: empty-contact 4986 :tags: server, zone 4987 :short: Specifies the contact name in the returned SOA record for empty zones. 4988 4989 This specifies the contact name that appears in the returned SOA record for 4990 empty zones. If none is specified, "." is used. 4991 4992 .. namedconf:statement:: empty-zones-enable 4993 :tags: server, zone 4994 :short: Enables or disables all empty zones. 4995 4996 This enables or disables all empty zones. By default, they are enabled. 4997 4998 .. namedconf:statement:: disable-empty-zone 4999 :tags: server, zone 5000 :short: Disables individual empty zones. 5001 5002 This disables individual empty zones. By default, none are disabled. This 5003 option can be specified multiple times. 5004 5005 .. _content_filtering: 5006 5007 Content Filtering 5008 ^^^^^^^^^^^^^^^^^ 5009 5010 .. namedconf:statement:: deny-answer-addresses 5011 :tags: query 5012 :short: Rejects A or AAAA records if the corresponding IPv4 or IPv6 addresses match a given :any:`address_match_list`. 5013 5014 BIND 9 provides the ability to filter out responses from external 5015 DNS servers containing certain types of data in the answer section. 5016 Specifically, it can reject address (A or AAAA) records if the 5017 corresponding IPv4 or IPv6 addresses match the given 5018 :term:`address_match_list` of the :any:`deny-answer-addresses` option. 5019 5020 In the :term:`address_match_list` of the :any:`deny-answer-addresses` option, 5021 only :term:`ip_address` and :term:`netprefix` are meaningful; any :term:`server_key` is 5022 silently ignored. 5023 5024 .. namedconf:statement:: deny-answer-aliases 5025 :tags: query 5026 :short: Rejects CNAME or DNAME records if the "alias" name matches a given list of :any:`domain_name` elements. 5027 5028 BIND can 5029 also reject CNAME or DNAME records if the "alias" name (i.e., the CNAME 5030 alias or the substituted query name due to DNAME) matches the given 5031 list of :term:`domain_name` elements of the :any:`deny-answer-aliases` option, 5032 where "match" means the alias name is a subdomain of one of the listed domain names. If 5033 the optional list is specified in the ``except-from`` argument, records 5034 whose query name matches the list are accepted regardless of the 5035 filter setting. Likewise, if the alias name is a subdomain of the 5036 corresponding zone, the :any:`deny-answer-aliases` filter does not apply; 5037 for example, even if "example.com" is specified for 5038 :any:`deny-answer-aliases`, 5039 5040 :: 5041 5042 www.example.com. CNAME xxx.example.com. 5043 5044 returned by an "example.com" server is accepted. 5045 5046 If a response message is rejected due to filtering, the entire 5047 message is discarded without being cached and a SERVFAIL error is 5048 returned to the client. 5049 5050 This filtering is intended to prevent "DNS rebinding attacks," in which 5051 an attacker, in response to a query for a domain name the attacker 5052 controls, returns an IP address within the user's own network or an alias name 5053 within the user's own domain. A naive web browser or script could then serve 5054 as an unintended proxy, allowing the attacker to get access to an 5055 internal node of the local network that could not be externally accessed 5056 otherwise. See the paper available at 5057 https://dl.acm.org/doi/10.1145/1315245.1315298 for more details 5058 about these attacks. 5059 5060 For example, with a domain named "example.net" and an internal 5061 network using an IPv4 prefix 192.0.2.0/24, an administrator might specify the 5062 following rules: 5063 5064 :: 5065 5066 deny-answer-addresses { 192.0.2.0/24; } except-from { "example.net"; }; 5067 deny-answer-aliases { "example.net"; }; 5068 5069 If an external attacker let a web browser in the local network look up 5070 an IPv4 address of "attacker.example.com", the attacker's DNS server 5071 would return a response like this: 5072 5073 :: 5074 5075 attacker.example.com. A 192.0.2.1 5076 5077 in the answer section. Since the rdata of this record (the IPv4 address) 5078 matches the specified prefix 192.0.2.0/24, this response would be 5079 ignored. 5080 5081 On the other hand, if the browser looked up a legitimate internal web 5082 server "www.example.net" and the following response were returned to the 5083 BIND 9 server: 5084 5085 :: 5086 5087 www.example.net. A 192.0.2.2 5088 5089 it would be accepted, since the owner name "www.example.net" matches the 5090 ``except-from`` element, "example.net". 5091 5092 Note that this is not really an attack on the DNS per se. In fact, there 5093 is nothing wrong with having an "external" name mapped to an "internal" 5094 IP address or domain name from the DNS point of view; it might actually 5095 be provided for a legitimate purpose, such as for debugging. As long as 5096 the mapping is provided by the correct owner, it either is not possible or does 5097 not make sense to detect whether the intent of the mapping is legitimate 5098 within the DNS. The "rebinding" attack must primarily be 5099 protected at the application that uses the DNS. For a large site, 5100 however, it may be difficult to protect all possible applications at 5101 once. This filtering feature is provided only to help such an 5102 operational environment; turning it on is generally discouraged 5103 unless there is no other choice and the attack is a 5104 real threat to applications. 5105 5106 Care should be particularly taken if using this option for 5107 addresses within 127.0.0.0/8. These addresses are obviously "internal," 5108 but many applications conventionally rely on a DNS mapping from some 5109 name to such an address. Filtering out DNS records containing this 5110 address spuriously can break such applications. 5111 5112 .. _rpz: 5113 5114 Response Policy Zone (RPZ) Rewriting 5115 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 5116 5117 BIND 9 includes a limited mechanism to modify DNS responses for requests 5118 analogous to email anti-spam DNS rejection lists. Responses can be changed to 5119 deny the existence of domains (NXDOMAIN), deny the existence of IP 5120 addresses for domains (NODATA), or contain other IP addresses or data. 5121 5122 .. namedconf:statement:: response-policy 5123 :tags: server, query, zone, security 5124 :short: Specifies response policy zones for the view or among global options. 5125 5126 Response policy zones are named in the :any:`response-policy` option for 5127 the view, or among the global options if there is no :any:`response-policy` 5128 option for the view. Response policy zones are ordinary DNS zones 5129 containing RRsets that can be queried normally if allowed. It is usually 5130 best to restrict those queries with something like 5131 ``allow-query { localhost; };``. 5132 5133 A :any:`response-policy` option can support multiple policy zones. To 5134 maximize performance, a radix tree is used to quickly identify response 5135 policy zones containing triggers that match the current query. This 5136 imposes an upper limit of 64 on the number of policy zones in a single 5137 :any:`response-policy` option; more than that is a configuration error. 5138 5139 Rules encoded in response policy zones are processed after those defined in 5140 :ref:`access_control`. All queries from clients which are not permitted access 5141 to the resolver are answered with a status code of REFUSED, regardless of 5142 configured RPZ rules. 5143 5144 Five policy triggers can be encoded in RPZ records. 5145 5146 ``RPZ-CLIENT-IP`` 5147 IP records are triggered by the IP address of the DNS client. Client 5148 IP address triggers are encoded in records that have owner names that 5149 are subdomains of ``rpz-client-ip``, relativized to the policy zone 5150 origin name, and that encode an address or address block. IPv4 addresses 5151 are represented as ``prefixlength.B4.B3.B2.B1.rpz-client-ip``. The 5152 IPv4 prefix length must be between 1 and 32. All four bytes - B4, B3, 5153 B2, and B1 - must be present. B4 is the decimal value of the least 5154 significant byte of the IPv4 address as in IN-ADDR.ARPA. 5155 5156 IPv6 addresses are encoded in a format similar to the standard IPv6 5157 text representation, 5158 ``prefixlength.W8.W7.W6.W5.W4.W3.W2.W1.rpz-client-ip``. Each of 5159 W8,...,W1 is a one- to four-digit hexadecimal number representing 16 5160 bits of the IPv6 address as in the standard text representation of 5161 IPv6 addresses, but reversed as in IP6.ARPA. (Note that this 5162 representation of IPv6 addresses is different from IP6.ARPA, where each 5163 hex digit occupies a label.) All 8 words must be present except when 5164 one set of consecutive zero words is replaced with ``.zz.``, analogous 5165 to double colons (::) in standard IPv6 text encodings. The IPv6 5166 prefix length must be between 1 and 128. 5167 5168 ``QNAME`` 5169 QNAME policy records are triggered by query names of requests and 5170 targets of CNAME records resolved to generate the response. The owner 5171 name of a QNAME policy record is the query name relativized to the 5172 policy zone. 5173 5174 ``RPZ-IP`` 5175 IP triggers are IP addresses in an A or AAAA record in the ANSWER 5176 section of a response. They are encoded like client-IP triggers, 5177 except as subdomains of ``rpz-ip``. 5178 5179 ``RPZ-NSDNAME`` 5180 NSDNAME triggers match names of authoritative servers for the query name, a 5181 parent of the query name, a CNAME for the query name, or a parent of a CNAME. 5182 They are encoded as subdomains of ``rpz-nsdname``, relativized 5183 to the RPZ origin name. NSIP triggers match IP addresses in A and AAAA 5184 RRsets for domains that can be checked against NSDNAME policy records. The 5185 ``nsdname-enable`` phrase turns NSDNAME triggers off or on for a single 5186 policy zone or for all zones. 5187 5188 If authoritative name servers for the query name are not yet known, :iscman:`named` 5189 recursively looks up the authoritative servers for the query name before 5190 applying an RPZ-NSDNAME rule, which can cause a processing delay. To speed up 5191 processing at the cost of precision, the ``nsdname-wait-recurse`` option can 5192 be used; when set to ``no``, RPZ-NSDNAME rules are only applied when 5193 authoritative servers for the query name have already been looked up and 5194 cached. If authoritative servers for the query name are not in the cache, 5195 the RPZ-NSDNAME rule is ignored, but the authoritative servers for 5196 the query name are looked up in the background and the rule is 5197 applied to subsequent queries. The default is ``yes``, 5198 meaning RPZ-NSDNAME rules are always applied, even if authoritative 5199 servers for the query name need to be looked up first. 5200 5201 ``RPZ-NSIP`` 5202 NSIP triggers match the IP addresses of authoritative servers. They 5203 are encoded like IP triggers, except as subdomains of ``rpz-nsip``. 5204 NSDNAME and NSIP triggers are checked only for names with at least 5205 ``min-ns-dots`` dots. The default value of ``min-ns-dots`` is 1, to 5206 exclude top-level domains. The ``nsip-enable`` phrase turns NSIP 5207 triggers off or on for a single policy zone or for all zones. 5208 5209 If a name server's IP address is not yet known, :iscman:`named` 5210 recursively looks up the IP address before applying an RPZ-NSIP rule, 5211 which can cause a processing delay. To speed up processing at the cost 5212 of precision, the ``nsip-wait-recurse`` option can be used; when set 5213 to ``no``, RPZ-NSIP rules are only applied when a name server's 5214 IP address has already been looked up and cached. If a server's IP 5215 address is not in the cache, the RPZ-NSIP rule is ignored, 5216 but the address is looked up in the background and the rule 5217 is applied to subsequent queries. The default is ``yes``, 5218 meaning RPZ-NSIP rules are always applied, even if an address 5219 needs to be looked up first. 5220 5221 The query response is checked against all response policy zones, so two 5222 or more policy records can be triggered by a response. Because DNS 5223 responses are rewritten according to at most one policy record, a single 5224 record encoding an action (other than ``DISABLED`` actions) must be 5225 chosen. Triggers, or the records that encode them, are chosen for 5226 rewriting in the following order: 5227 5228 1. Choose the triggered record in the zone that appears first in the 5229 response-policy option. 5230 2. Prefer CLIENT-IP to QNAME to IP to NSDNAME to NSIP triggers in a 5231 single zone. 5232 3. Among NSDNAME triggers, prefer the trigger that matches the smallest 5233 name under the DNSSEC ordering. 5234 4. Among IP or NSIP triggers, prefer the trigger with the longest 5235 prefix. 5236 5. Among triggers with the same prefix length, prefer the IP or NSIP 5237 trigger that matches the smallest IP address. 5238 5239 When the processing of a response is restarted to resolve DNAME or CNAME 5240 records and a policy record set has not been triggered, all response 5241 policy zones are again consulted for the DNAME or CNAME names and 5242 addresses. 5243 5244 RPZ record sets are any types of DNS record, except DNAME or DNSSEC, that 5245 encode actions or responses to individual queries. Any of the policies 5246 can be used with any of the triggers. For example, while the 5247 ``TCP-only`` policy is commonly used with ``client-IP`` triggers, it can 5248 be used with any type of trigger to force the use of TCP for responses 5249 with owner names in a zone. 5250 5251 ``PASSTHRU`` 5252 The auto-acceptance policy is specified by a CNAME whose target is 5253 ``rpz-passthru``. It causes the response to not be rewritten and is 5254 most often used to "poke holes" in policies for CIDR blocks. 5255 5256 ``DROP`` 5257 The auto-rejection policy is specified by a CNAME whose target is 5258 ``rpz-drop``. It causes the response to be discarded. Nothing is sent 5259 to the DNS client. 5260 5261 ``TCP-Only`` 5262 The "slip" policy is specified by a CNAME whose target is 5263 ``rpz-tcp-only``. It changes UDP responses to short, truncated DNS 5264 responses that require the DNS client to try again with TCP. It is 5265 used to mitigate distributed DNS reflection attacks. 5266 5267 ``NXDOMAIN`` 5268 The "domain undefined" response is encoded by a CNAME whose target is 5269 the root domain (.). 5270 5271 ``NODATA`` 5272 The empty set of resource records is specified by a CNAME whose target 5273 is the wildcard top-level domain (``*.``). It rewrites the response to 5274 NODATA or ANCOUNT=0. 5275 5276 ``Local Data`` 5277 A set of ordinary DNS records can be used to answer queries. Queries 5278 for record types not in the set are answered with NODATA. 5279 5280 A special form of local data is a CNAME whose target is a wildcard 5281 such as \*.example.com. It is used as if an ordinary CNAME after 5282 the asterisk (\*) has been replaced with the query name. 5283 This special form is useful for query logging in the walled garden's 5284 authoritative DNS server. 5285 5286 All of the actions specified in all of the individual records in a 5287 policy zone can be overridden with a ``policy`` clause in the 5288 :any:`response-policy` option. An organization using a policy zone provided 5289 by another organization might use this mechanism to redirect domains to 5290 its own walled garden. 5291 5292 ``GIVEN`` 5293 The placeholder policy says "do not override but perform the action 5294 specified in the zone." 5295 5296 ``DISABLED`` 5297 The testing override policy causes policy zone records to do nothing 5298 but log what they would have done if the policy zone were not 5299 disabled. The response to the DNS query is written (or not) 5300 according to any triggered policy records that are not disabled. 5301 Disabled policy zones should appear first, because they are often 5302 not logged if a higher-precedence trigger is found first. 5303 5304 ``PASSTHRU``; ``DROP``; ``TCP-Only``; ``NXDOMAIN``; ``NODATA`` 5305 These settings each override the corresponding per-record policy. 5306 5307 ``CNAME domain`` 5308 This causes all RPZ policy records to act as if they were "cname domain" 5309 records. 5310 5311 By default, the actions encoded in a response policy zone are applied 5312 only to queries that ask for recursion (RD=1). That default can be 5313 changed for a single policy zone, or for all response policy zones in a view, 5314 with a ``recursive-only no`` clause. This feature is useful for serving 5315 the same zone files both inside and outside an :rfc:`1918` cloud and using 5316 RPZ to delete answers that would otherwise contain :rfc:`1918` values on 5317 the externally visible name server or view. 5318 5319 Also by default, when :iscman:`named` is started it may start answering to 5320 queries before the response policy zones are completely loaded and processed. 5321 This can be changed with the ``servfail-until-ready yes`` option, in which case 5322 incoming requests will result in SERVFAIL answer, until all the response policy 5323 zones are ready. Note that if one or more response policy zones fail to load, 5324 :iscman:`named` starts responding to queries according to those zones that did 5325 load. Note, that enabling this option has no effect when a DNS Response Policy 5326 Service (DNSRPS) interface is used. 5327 5328 Also by default, RPZ actions are applied only to DNS requests that 5329 either do not request DNSSEC metadata (DO=0) or when no DNSSEC records 5330 are available for the requested name in the original zone (not the response 5331 policy zone). This default can be changed for all response policy zones 5332 in a view with a ``break-dnssec yes`` clause. In that case, RPZ actions 5333 are applied regardless of DNSSEC. The name of the clause option reflects 5334 the fact that results rewritten by RPZ actions cannot verify. 5335 5336 No DNS records are needed for a QNAME or Client-IP trigger; the name or 5337 IP address itself is sufficient, so in principle the query name need not 5338 be recursively resolved. However, not resolving the requested name can 5339 leak the fact that response policy rewriting is in use, and that the name 5340 is listed in a policy zone, to operators of servers for listed names. To 5341 prevent that information leak, by default any recursion needed for a 5342 request is done before any policy triggers are considered. Because 5343 listed domains often have slow authoritative servers, this behavior can 5344 cost significant time. The ``qname-wait-recurse no`` option overrides 5345 the default and enables that behavior when recursion cannot change a 5346 non-error response. The option does not affect QNAME or client-IP 5347 triggers in policy zones listed after other zones containing IP, NSIP, 5348 and NSDNAME triggers, because those may depend on the A, AAAA, and NS 5349 records that would be found during recursive resolution. It also does 5350 not affect DNSSEC requests (DO=1) unless ``break-dnssec yes`` is in use, 5351 because the response would depend on whether RRSIG records were 5352 found during resolution. Using this option can cause error responses 5353 such as SERVFAIL to appear to be rewritten, since no recursion is being 5354 done to discover problems at the authoritative server. 5355 5356 .. namedconf:statement:: dnsrps-enable 5357 :tags: server, security 5358 :short: Turns on the DNS Response Policy Service (DNSRPS) interface. 5359 5360 The ``dnsrps-enable yes`` option turns on the DNS Response Policy Service 5361 (DNSRPS) interface, if it has been compiled in :iscman:`named` using 5362 ``configure --enable-dnsrps``. 5363 5364 .. namedconf:statement:: dnsrps-library 5365 :tags: server, security 5366 :short: Specifies the path to the DNS Response Policy Service (DNSRPS) provider library. 5367 5368 This option specifies the path to the DNSRPS provider library. Typically 5369 this library is detected when building with ``configure --enable-dnsrps`` 5370 and does not need to be specified in ``named.conf``; the option exists 5371 to override the default library for testing purposes. 5372 5373 .. namedconf:statement:: dnsrps-options 5374 :tags: server, security 5375 :short: Provides additional RPZ configuration settings, which are passed to the DNS Response Policy Service (DNSRPS) provider library. 5376 5377 The block provides additional RPZ configuration 5378 settings, which are passed through to the DNSRPS provider library. 5379 Multiple DNSRPS settings in an :any:`dnsrps-options` string should be 5380 separated with semi-colons (;). The DNSRPS provider library is passed a 5381 configuration string consisting of the :any:`dnsrps-options` text, 5382 concatenated with settings derived from the :any:`response-policy` 5383 statement. 5384 5385 Note: the :any:`dnsrps-options` text should only include configuration 5386 settings that are specific to the DNSRPS provider. For example, the 5387 DNSRPS provider from Farsight Security takes options such as 5388 ``dnsrpzd-conf``, ``dnsrpzd-sock``, and ``dnzrpzd-args`` (for details of 5389 these options, see the ``librpz`` documentation). Other RPZ 5390 configuration settings could be included in :any:`dnsrps-options` as well, 5391 but if :iscman:`named` were switched back to traditional RPZ by setting 5392 :any:`dnsrps-enable` to "no", those options would be ignored. 5393 5394 The TTL of a record modified by RPZ policies is set from the TTL of the 5395 relevant record in the policy zone. It is then limited to a maximum value. 5396 The ``max-policy-ttl`` clause changes the maximum number of seconds from its 5397 default of 5. For convenience, TTL-style time-unit suffixes may be used 5398 to specify the value. It also accepts ISO 8601 duration formats. 5399 5400 For example, an administrator might use this option statement: 5401 5402 :: 5403 5404 response-policy { zone "badlist"; }; 5405 5406 and this zone statement: 5407 5408 :: 5409 5410 zone "badlist" {type primary; file "primary/badlist"; allow-query {none;}; }; 5411 5412 with this zone file: 5413 5414 :: 5415 5416 $TTL 1H 5417 @ SOA LOCALHOST. named-mgr.example.com (1 1h 15m 30d 2h) 5418 NS LOCALHOST. 5419 5420 ; QNAME policy records. There are no periods (.) after the owner names. 5421 nxdomain.domain.com CNAME . ; NXDOMAIN policy 5422 *.nxdomain.domain.com CNAME . ; NXDOMAIN policy 5423 nodata.domain.com CNAME *. ; NODATA policy 5424 *.nodata.domain.com CNAME *. ; NODATA policy 5425 bad.domain.com A 10.0.0.1 ; redirect to a walled garden 5426 AAAA 2001:2::1 5427 bzone.domain.com CNAME garden.example.com. 5428 5429 ; do not rewrite (PASSTHRU) OK.DOMAIN.COM 5430 ok.domain.com CNAME rpz-passthru. 5431 5432 ; redirect x.bzone.domain.com to x.bzone.domain.com.garden.example.com 5433 *.bzone.domain.com CNAME *.garden.example.com. 5434 5435 ; IP policy records that rewrite all responses containing A records in 127/8 5436 ; except 127.0.0.1 5437 8.0.0.0.127.rpz-ip CNAME . 5438 32.1.0.0.127.rpz-ip CNAME rpz-passthru. 5439 5440 ; NSDNAME and NSIP policy records 5441 ns.domain.com.rpz-nsdname CNAME . 5442 48.zz.2.2001.rpz-nsip CNAME . 5443 5444 ; auto-reject and auto-accept some DNS clients 5445 112.zz.2001.rpz-client-ip CNAME rpz-drop. 5446 8.0.0.0.127.rpz-client-ip CNAME rpz-drop. 5447 5448 ; force some DNS clients and responses in the example.com zone to TCP 5449 16.0.0.1.10.rpz-client-ip CNAME rpz-tcp-only. 5450 example.com CNAME rpz-tcp-only. 5451 *.example.com CNAME rpz-tcp-only. 5452 5453 Response policy zones can be configured to set an Extended DNS Error (EDE) code 5454 on the responses which have been modified by the response policy: 5455 5456 :: 5457 5458 response-policy { zone "badlist" ede filtered; }; 5459 5460 The following settings are supported for the ``ede`` option: 5461 5462 ``none`` 5463 No Extended DNS Error code is set (default). 5464 5465 ``forged`` 5466 Extended DNS Error code 4 - Forged Answer. 5467 5468 ``blocked`` 5469 Extended DNS Error code 15 - Blocked. 5470 5471 ``censored`` 5472 Extended DNS Error code 16 - Censored. 5473 5474 ``filtered`` 5475 Extended DNS Error code 17 - Filtered. 5476 5477 ``prohibited`` 5478 Extended DNS Error code 18 - Prohibited. 5479 5480 See :rfc:`8914` for more information about the Extended DNS Error codes. 5481 5482 RPZ can affect server performance. Each configured response policy zone 5483 requires the server to perform one to four additional database lookups 5484 before a query can be answered. For example, a DNS server with four 5485 policy zones, each with all four kinds of response triggers (QNAME, IP, 5486 NSIP, and NSDNAME), requires a total of 17 times as many database lookups 5487 as a similar DNS server with no response policy zones. A BIND 9 server 5488 with adequate memory and one response policy zone with QNAME and IP 5489 triggers might achieve a maximum queries-per-second (QPS) rate about 20% 5490 lower. A server with four response policy zones with QNAME and IP 5491 triggers might have a maximum QPS rate about 50% lower. 5492 5493 Responses rewritten by RPZ are counted in the ``RPZRewrites`` 5494 statistics. 5495 5496 The ``log`` clause can be used to optionally turn off rewrite logging 5497 for a particular response policy zone. By default, all rewrites are 5498 logged. 5499 5500 The ``add-soa`` option controls whether the RPZ's SOA record is added to 5501 the section for traceback of changes from this zone. 5502 This can be set at the individual policy zone level or at the 5503 response-policy level. The default is ``yes``. 5504 5505 Updates to RPZ zones are processed asynchronously; if there is more than 5506 one update pending they are bundled together. If an update to a RPZ zone 5507 (for example, via IXFR) happens less than ``min-update-interval`` 5508 seconds after the most recent update, the changes are not 5509 carried out until this interval has elapsed. The default is ``60`` 5510 seconds. For convenience, TTL-style time-unit suffixes may be used to 5511 specify the value. It also accepts ISO 8601 duration formats. 5512 5513 .. _rrl: 5514 5515 Response Rate Limiting 5516 ^^^^^^^^^^^^^^^^^^^^^^ 5517 5518 .. namedconf:statement:: rate-limit 5519 :tags: query 5520 :short: Controls excessive UDP responses, to prevent BIND 9 from being used to amplify reflection denial-of-service (DoS) attacks. 5521 5522 Excessive, almost-identical UDP *responses* can be controlled by 5523 configuring a :any:`rate-limit` clause in an :namedconf:ref:`options` or :any:`view` 5524 statement. This mechanism keeps authoritative BIND 9 from being used to 5525 amplify reflection denial-of-service (DoS) attacks. Short BADCOOKIE errors or 5526 truncated (TC=1) responses can be sent to provide rate-limited responses to 5527 legitimate clients within a range of forged, attacked IP addresses. 5528 Legitimate clients react to dropped responses by retrying, 5529 to BADCOOKIE errors by including a server cookie when retrying, 5530 and to truncated responses by switching to TCP. 5531 5532 This mechanism is intended for authoritative DNS servers. It can be used 5533 on recursive servers, but can slow applications such as SMTP servers 5534 (mail receivers) and HTTP clients (web browsers) that repeatedly request 5535 the same domains. When possible, closing "open" recursive servers is 5536 better. 5537 5538 Response-rate limiting uses a "credit" or "token bucket" scheme. Each 5539 combination of identical response and client has a conceptual "account" 5540 that earns a specified number of credits every second. A prospective 5541 response debits its account by one. Responses are dropped or truncated 5542 while the account is negative. 5543 5544 .. namedconf:statement:: window 5545 :tags: query 5546 :short: Specifies the length of time during which responses are tracked. 5547 5548 Responses are tracked within a rolling 5549 window of time which defaults to 15 seconds, but which can be configured with 5550 the :any:`window` option to any value from 1 to 3600 seconds (1 hour). The 5551 account cannot become more positive than the per-second limit or more 5552 negative than :any:`window` times the per-second limit. When the specified 5553 number of credits for a class of responses is set to 0, those responses 5554 are not rate-limited. 5555 5556 .. namedconf:statement:: ipv4-prefix-length 5557 :tags: server 5558 :short: Specifies the prefix lengths of IPv4 address blocks. 5559 5560 .. namedconf:statement:: ipv6-prefix-length 5561 :tags: server 5562 :short: Specifies the prefix lengths of IPv6 address blocks. 5563 5564 The notions of "identical response" and "DNS client" for rate limiting 5565 are not simplistic. All responses to an address block are counted as if 5566 to a single client. The prefix lengths of address blocks are specified 5567 with :any:`ipv4-prefix-length` (default 24) and :any:`ipv6-prefix-length` 5568 (default 56). 5569 5570 .. namedconf:statement:: responses-per-second 5571 :tags: query 5572 :short: Limits the number of non-empty responses for a valid domain name and record type. 5573 5574 All non-empty responses for a valid domain name (qname) and record type 5575 (qtype) are identical and have a limit specified with 5576 :any:`responses-per-second` (default 0 or no limit). All valid wildcard 5577 domain names are interpreted as the zone's origin name concatenated to the 5578 "*" name. 5579 5580 .. namedconf:statement:: nodata-per-second 5581 :tags: query 5582 :short: Limits the number of empty (NODATA) responses for a valid domain name. 5583 5584 All empty (NODATA) 5585 responses for a valid domain, regardless of query type, are identical. 5586 Responses in the NODATA class are limited by :any:`nodata-per-second` 5587 (default :any:`responses-per-second`). 5588 5589 .. namedconf:statement:: nxdomains-per-second 5590 :tags: query 5591 :short: Limits the number of undefined subdomains for a valid domain name. 5592 5593 Requests for any and all undefined 5594 subdomains of a given valid domain result in NXDOMAIN errors, and are 5595 identical regardless of query type. They are limited by 5596 :any:`nxdomains-per-second` (default :any:`responses-per-second`). This 5597 controls some attacks using random names, but can be relaxed or turned 5598 off (set to 0) on servers that expect many legitimate NXDOMAIN 5599 responses, such as from anti-spam rejection lists. 5600 5601 .. namedconf:statement:: referrals-per-second 5602 :tags: query 5603 :short: Limits the number of referrals or delegations to a server for a given domain. 5604 5605 Referrals or delegations 5606 to the server of a given domain are identical and are limited by 5607 :any:`referrals-per-second` (default :any:`responses-per-second`). 5608 5609 Responses generated from local wildcards are counted and limited as if 5610 they were for the parent domain name. This controls flooding using 5611 random.wild.example.com. 5612 5613 All requests that result in DNS errors other than NXDOMAIN, such as 5614 SERVFAIL and FORMERR, are identical regardless of requested name (qname) 5615 or record type (qtype). This controls attacks using invalid requests or 5616 distant, broken authoritative servers. 5617 5618 5619 .. namedconf:statement:: errors-per-second 5620 :tags: server 5621 :short: Limits the number of errors for a valid domain name and record type. 5622 5623 By default the limit on errors is 5624 the same as the :any:`responses-per-second` value, but it can be set 5625 separately with :any:`errors-per-second`. 5626 5627 .. namedconf:statement:: slip 5628 :tags: query 5629 :short: Sets the number of "slipped" responses to minimize the use of forged source addresses for an attack. 5630 5631 Many attacks using DNS involve UDP requests with forged source 5632 addresses. Rate limiting prevents the use of BIND 9 to flood a network 5633 with responses to requests with forged source addresses, but could let a 5634 third party block responses to legitimate requests. There is a mechanism 5635 that can answer some legitimate requests from a client whose address is 5636 being forged in a flood. Setting :any:`slip` to 2 (its default) causes 5637 every other UDP request without a valid server cookie to be answered with 5638 a small response. The small size and reduced frequency, and resulting lack of 5639 amplification, of "slipped" responses make them unattractive for 5640 reflection DoS attacks. :any:`slip` must be between 0 and 10. A value of 0 5641 does not "slip"; no small responses are sent due to rate limiting. Rather, 5642 all responses are dropped. A value of 1 causes every response to slip; 5643 values between 2 and 10 cause every nth response to slip. 5644 5645 If the request included a client cookie, then a "slipped" response is 5646 a BADCOOKIE error with a server cookie, which allows a legitimate client 5647 to include the server cookie to be exempted from the rate limiting 5648 when it retries the request. 5649 If the request did not include a cookie, then a "slipped" response is 5650 a truncated (TC=1) response, which prompts a legitimate client to 5651 switch to TCP and thus be exempted from the rate limiting. Some error 5652 responses, including REFUSED and SERVFAIL, cannot be replaced with 5653 truncated responses and are instead leaked at the :any:`slip` rate. 5654 5655 (Note: dropped responses from an authoritative server may reduce the 5656 difficulty of a third party successfully forging a response to a 5657 recursive resolver. The best security against forged responses is for 5658 authoritative operators to sign their zones using DNSSEC and for 5659 resolver operators to validate the responses. When this is not an 5660 option, operators who are more concerned with response integrity than 5661 with flood mitigation may consider setting :any:`slip` to 1, causing all 5662 rate-limited responses to be truncated rather than dropped. This reduces 5663 the effectiveness of rate-limiting against reflection attacks.) 5664 5665 .. namedconf:statement:: qps-scale 5666 :tags: query 5667 :short: Tightens defenses during DNS attacks by scaling back the ratio of the current query-per-second rate. 5668 5669 When the approximate query-per-second rate exceeds the :any:`qps-scale` 5670 value, the :any:`responses-per-second`, :any:`errors-per-second`, 5671 :any:`nxdomains-per-second`, and :any:`all-per-second` values are reduced by 5672 the ratio of the current rate to the :any:`qps-scale` value. This feature 5673 can tighten defenses during attacks. For example, with 5674 ``qps-scale 250; responses-per-second 20;`` and a total query rate of 5675 1000 queries/second for all queries from all DNS clients including via 5676 TCP, then the effective responses/second limit changes to (250/1000)*20, 5677 or 5. Responses to requests that included a valid server cookie, 5678 and responses sent via TCP, are not limited but are counted to compute 5679 the query-per-second rate. 5680 5681 .. namedconf:statement:: exempt-clients 5682 :tags: query 5683 :short: Exempts specific clients or client groups from rate limiting. 5684 5685 Communities of DNS clients can be given their own parameters or no 5686 rate limiting by putting :any:`rate-limit` statements in :any:`view` statements 5687 instead of in the global ``option`` statement. A :any:`rate-limit` statement 5688 in a view replaces, rather than supplements, a :any:`rate-limit` 5689 statement among the main options. 5690 5691 DNS clients within a view can be 5692 exempted from rate limits with the :any:`exempt-clients` clause. 5693 5694 .. namedconf:statement:: all-per-second 5695 :tags: query 5696 :short: Limits UDP responses of all kinds. 5697 5698 UDP responses of all kinds can be limited with the :any:`all-per-second` 5699 phrase. This rate limiting is unlike the rate limiting provided by 5700 :any:`responses-per-second`, :any:`errors-per-second`, and 5701 :any:`nxdomains-per-second` on a DNS server, which are often invisible to 5702 the victim of a DNS reflection attack. Unless the forged requests of the 5703 attack are the same as the legitimate requests of the victim, the 5704 victim's requests are not affected. Responses affected by an 5705 :any:`all-per-second` limit are always dropped; the :any:`slip` value has no 5706 effect. An :any:`all-per-second` limit should be at least 4 times as large 5707 as the other limits, because single DNS clients often send bursts of 5708 legitimate requests. For example, the receipt of a single mail message 5709 can prompt requests from an SMTP server for NS, PTR, A, and AAAA records 5710 as the incoming SMTP/TCP/IP connection is considered. The SMTP server 5711 can need additional NS, A, AAAA, MX, TXT, and SPF records as it 5712 considers the SMTP ``Mail From`` command. Web browsers often repeatedly 5713 resolve the same names that are duplicated in HTML <IMG> tags in a page. 5714 :any:`all-per-second` is similar to the rate limiting offered by firewalls 5715 but is often inferior. Attacks that justify ignoring the contents of DNS 5716 responses are likely to be attacks on the DNS server itself. They 5717 usually should be discarded before the DNS server spends resources making 5718 TCP connections or parsing DNS requests, but that rate limiting must be 5719 done before the DNS server sees the requests. 5720 5721 5722 .. namedconf:statement:: max-table-size 5723 :tags: server 5724 :short: Sets the maximum size of the table used to track requests and rate-limit responses. 5725 5726 .. namedconf:statement:: min-table-size 5727 :tags: query 5728 :short: Sets the minimum size of the table used to track requests and rate-limit responses. 5729 5730 The maximum size of the table used to track requests and rate-limit 5731 responses is set with :any:`max-table-size`. Each entry in the table is 5732 between 40 and 80 bytes. The table needs approximately as many entries 5733 as the number of requests received per second. The default is 20,000. To 5734 reduce the cold start of growing the table, :any:`min-table-size` (default 500) 5735 can set the minimum table size. Enable :any:`rate-limit` category 5736 logging to monitor expansions of the table and inform choices for the 5737 initial and maximum table size. 5738 5739 .. namedconf:statement:: log-only 5740 :tags: logging, query 5741 :short: Tests rate-limiting parameters without actually dropping any requests. 5742 5743 Use ``log-only yes`` to test rate-limiting parameters without actually 5744 dropping any requests. 5745 5746 Responses dropped by rate limits are included in the ``RateDropped`` and 5747 ``QryDropped`` statistics. Responses that are truncated by rate limits are 5748 included in ``RateSlipped`` and ``RespTruncated``. 5749 5750 NXDOMAIN Redirection 5751 ^^^^^^^^^^^^^^^^^^^^ 5752 5753 :iscman:`named` supports NXDOMAIN redirection via two methods: 5754 5755 - :any:`Redirect zone <type redirect>` 5756 - Redirect namespace 5757 5758 With either method, when :iscman:`named` gets an NXDOMAIN response it examines a 5759 separate namespace to see if the NXDOMAIN response should be replaced 5760 with an alternative response. 5761 5762 With a redirect zone (``zone "." { type redirect; };``), the data used 5763 to replace the NXDOMAIN is held in a single zone which is not part of 5764 the normal namespace. All the redirect information is contained in the 5765 zone; there are no delegations. 5766 5767 .. namedconf:statement:: nxdomain-redirect 5768 :tags: query 5769 :short: Appends the specified suffix to the original query name, when replacing an NXDOMAIN with a redirect namespace. 5770 5771 With a redirect namespace (``option { nxdomain-redirect <suffix> };``), 5772 the data used to replace the NXDOMAIN is part of the normal namespace 5773 and is looked up by appending the specified suffix to the original 5774 query name. This roughly doubles the cache required to process 5775 NXDOMAIN responses, as both the original NXDOMAIN response and the 5776 replacement data (or an NXDOMAIN indicating that there is no 5777 replacement) must be stored. 5778 5779 If both a redirect zone and a redirect namespace are configured, the 5780 redirect zone is tried first. 5781 5782 ``server`` Block Grammar 5783 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5784 .. namedconf:statement:: server 5785 :tags: server 5786 :short: Defines characteristics to be associated with a remote name server. 5787 5788 ``server`` Block Definition and Usage 5789 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5790 5791 The :namedconf:ref:`server` statement defines characteristics to be associated with a 5792 remote name server. If a prefix length is specified, then a range of 5793 servers is covered. Only the most specific server clause applies, 5794 regardless of the order in :iscman:`named.conf`. 5795 5796 The :rndcconf:ref:`server` statement can occur at the top level of the configuration 5797 file or inside a :any:`view` statement. If a :any:`view` statement contains 5798 one or more :namedconf:ref:`server` statements, only those apply to the view and any 5799 top-level ones are ignored. If a view contains no :namedconf:ref:`server` statements, 5800 any top-level :namedconf:ref:`server` statements are used as defaults. 5801 5802 5803 .. namedconf:statement:: bogus 5804 :tags: server 5805 :short: Allows a remote server to be ignored. 5806 5807 If a remote server is giving out bad data, marking it 5808 as bogus prevents further queries to it. The default value of 5809 :any:`bogus` is ``no``. 5810 5811 .. namedconf:statement:: edns 5812 :tags: server 5813 :short: Controls the use of the EDNS0 (:rfc:`2671`) feature. 5814 5815 The :any:`edns` clause determines whether the local server attempts to 5816 use EDNS when communicating with the remote server. The default is 5817 ``yes``. 5818 5819 .. namedconf:statement:: edns-version 5820 :tags: server 5821 :short: Sets the maximum EDNS VERSION that is sent to the server(s) by the resolver. 5822 5823 The :any:`edns-version` option sets the maximum EDNS VERSION that is 5824 sent to the server(s) by the resolver. The actual EDNS version sent is 5825 still subject to normal EDNS version-negotiation rules (see :rfc:`6891`), 5826 the maximum EDNS version supported by the server, and any other 5827 heuristics that indicate that a lower version should be sent. This 5828 option is intended to be used when a remote server reacts badly to a 5829 given EDNS version or higher; it should be set to the highest version 5830 the remote server is known to support. Valid values are 0 to 255; higher 5831 values are silently adjusted. This option is not needed until 5832 higher EDNS versions than 0 are in use. 5833 5834 .. namedconf:statement:: padding 5835 :tags: server 5836 :short: Adds EDNS Padding options to outgoing messages to increase the packet size. 5837 5838 The option adds EDNS Padding options to outgoing messages, 5839 increasing the packet size to a multiple of the specified block size. 5840 Valid block sizes range from 0 (the default, which disables the use of 5841 EDNS Padding) to 512 bytes. Larger values are reduced to 512, with a 5842 logged warning. Note: this option is not currently compatible with 5843 TSIG or SIG(0), as the EDNS OPT record containing the padding would have 5844 to be added to the packet after it had already been signed. 5845 5846 .. namedconf:statement:: tcp-only 5847 :tags: server 5848 :short: Sets the transport protocol to TCP. 5849 5850 The option sets the transport protocol to TCP. The default 5851 is to use the UDP transport and to fallback on TCP only when a truncated 5852 response is received. 5853 5854 .. namedconf:statement:: tcp-keepalive 5855 :tags: server 5856 :short: Adds EDNS TCP keepalive to messages sent over TCP. 5857 5858 The option adds EDNS TCP keepalive to messages sent 5859 over TCP. Note that currently idle timeouts in responses are ignored. 5860 5861 .. namedconf:statement:: transfers 5862 :tags: server 5863 :short: Limits the number of concurrent inbound zone transfers from a server. 5864 5865 :any:`transfers` is used to limit the number of concurrent inbound zone 5866 transfers from the specified server. If no :any:`transfers` clause is 5867 specified, the limit is set according to the :any:`transfers-per-ns` 5868 option. 5869 5870 .. namedconf:statement:: keys 5871 :tags: server, security 5872 :short: Specifies one or more :any:`server_key` s to be used with a remote server. 5873 :suppress_grammar: 5874 5875 .. warning:: 5876 This option is not to be confused with :any:`keys` in the :any:`dnssec-policy` specification. 5877 Although statements with the same name exist in both contexts, they refer 5878 to fundamentally incompatible concepts. 5879 5880 In the context of a :namedconf:ref:`server` block, the option identifies a 5881 :term:`server_key` defined by the :namedconf:ref:`key` statement, to be used for 5882 transaction security (see :ref:`tsig`) 5883 when talking to the remote server. When a request is sent to the remote 5884 server, a request signature is generated using the key specified 5885 here and appended to the message. A request originating from the remote 5886 server is not required to be signed by this key. 5887 5888 Only a single key per server is currently supported. 5889 5890 It is possible to override the following values defined in :namedconf:ref:`view` 5891 and :namedconf:ref:`options` blocks: 5892 5893 - :namedconf:ref:`edns-udp-size` 5894 - :namedconf:ref:`max-udp-size` 5895 - :namedconf:ref:`notify-source-v6` 5896 - :namedconf:ref:`notify-source` 5897 - :namedconf:ref:`provide-ixfr` 5898 - :namedconf:ref:`query-source-v6` 5899 - :namedconf:ref:`query-source` 5900 - :namedconf:ref:`request-expire` 5901 - :namedconf:ref:`request-ixfr` 5902 - :namedconf:ref:`request-nsid` 5903 - :namedconf:ref:`require-cookie` 5904 - :namedconf:ref:`send-cookie` 5905 - :namedconf:ref:`transfer-format` 5906 - :namedconf:ref:`transfer-source-v6` 5907 - :namedconf:ref:`transfer-source` 5908 5909 5910 :any:`statistics-channels` Block Grammar 5911 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5912 .. namedconf:statement:: statistics-channels 5913 :tags: logging 5914 :short: Specifies the communication channels to be used by system administrators to access statistics information on the name server. 5915 5916 :any:`statistics-channels` Block Definition and Usage 5917 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5918 5919 The :any:`statistics-channels` statement declares communication channels to 5920 be used by system administrators to get access to statistics information 5921 on the name server. 5922 5923 This statement is intended to be flexible to support multiple communication 5924 protocols in the future, but currently only HTTP access is supported. It 5925 requires that BIND 9 be compiled with libxml2 and/or json-c (also known 5926 as libjson0); the :any:`statistics-channels` statement is still accepted 5927 even if it is built without the library, but any HTTP access fails 5928 with an error. 5929 5930 An :any:`inet` control channel is a TCP socket listening at the specified 5931 :term:`port` on the specified :term:`ip_address`, which can be an IPv4 or IPv6 5932 address. An :term:`ip_address` of ``*`` (asterisk) is interpreted as the IPv4 5933 wildcard address; connections are accepted on any of the system's 5934 IPv4 addresses. To listen on the IPv6 wildcard address, use an 5935 :term:`ip_address` of ``::``. 5936 5937 If no port is specified, port 80 is used for HTTP channels. The asterisk 5938 (``*``) cannot be used for :term:`port`. 5939 5940 Attempts to open a statistics channel are restricted by the 5941 optional ``allow`` clause. Connections to the statistics channel are 5942 permitted based on the :term:`address_match_list`. If no ``allow`` clause is 5943 present, :iscman:`named` accepts connection attempts from any address. Since 5944 the statistics may contain sensitive internal information, the source of 5945 connection requests must be restricted appropriately so that only 5946 trusted parties can access the statistics channel. 5947 5948 Gathering data exposed by the statistics channel locks various subsystems in 5949 :iscman:`named`, which could slow down query processing if statistics data is 5950 requested too often. 5951 5952 An issue in the statistics channel would be considered a security issue 5953 only if it could be exploited by unprivileged users circumventing the access 5954 control list. In other words, any issue in the statistics channel that could be 5955 used to access information unavailable otherwise, or to crash :iscman:`named`, is 5956 not considered a security issue if it can be avoided through the 5957 use of a secure configuration. 5958 5959 If no :any:`statistics-channels` statement is present, :iscman:`named` does not 5960 open any communication channels. 5961 5962 The statistics are available in various formats and views, depending on 5963 the URI used to access them. For example, if the statistics channel is 5964 configured to listen on 127.0.0.1 port 8888, then the statistics are 5965 accessible in XML format at http://127.0.0.1:8888/ or 5966 http://127.0.0.1:8888/xml. A CSS file is included, which can format the 5967 XML statistics into tables when viewed with a stylesheet-capable 5968 browser, and into charts and graphs using the Google Charts API when 5969 using a JavaScript-capable browser. 5970 5971 Broken-out subsets of the statistics can be viewed at 5972 http://127.0.0.1:8888/xml/v3/status (server uptime and last 5973 reconfiguration time), http://127.0.0.1:8888/xml/v3/server (server and 5974 resolver statistics), http://127.0.0.1:8888/xml/v3/zones (zone 5975 statistics), http://127.0.0.1:8888/xml/v3/xfrins (incoming zone transfer 5976 statistics), http://127.0.0.1:8888/xml/v3/net (network status and socket 5977 statistics), http://127.0.0.1:8888/xml/v3/mem (memory manager 5978 statistics), and http://127.0.0.1:8888/xml/v3/traffic (traffic sizes). 5979 5980 The full set of statistics can also be read in JSON format at 5981 http://127.0.0.1:8888/json, with the broken-out subsets at 5982 http://127.0.0.1:8888/json/v1/status (server uptime and last 5983 reconfiguration time), http://127.0.0.1:8888/json/v1/server (server and 5984 resolver statistics), http://127.0.0.1:8888/json/v1/zones (zone 5985 statistics), http://127.0.0.1:8888/json/v1/xfrins (incoming zone transfer 5986 statistics), http://127.0.0.1:8888/json/v1/net (network status and 5987 socket statistics), http://127.0.0.1:8888/json/v1/mem (memory manager 5988 statistics), and http://127.0.0.1:8888/json/v1/traffic (traffic sizes). 5989 5990 :any:`tls` Block Grammar 5991 ~~~~~~~~~~~~~~~~~~~~~~~~~ 5992 .. namedconf:statement:: tls 5993 :tags: security 5994 :short: Configures a TLS connection. 5995 5996 :any:`tls` Block Definition and Usage 5997 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5998 5999 The :any:`tls` statement is used to configure a TLS connection; this 6000 configuration can then be referenced by a :any:`listen-on` or :any:`listen-on-v6` 6001 statement to cause :iscman:`named` to listen for incoming requests via TLS, 6002 or in the :any:`primaries` statement for a zone of :any:`type secondary` to 6003 cause zone transfer requests to be sent via TLS. 6004 6005 :any:`tls` can only be set at the top level of :iscman:`named.conf`. 6006 6007 The following options can be specified in a :any:`tls` statement: 6008 6009 .. namedconf:statement:: key-file 6010 :tags: server, security 6011 :short: Specifies the path to a file containing the private TLS key for a connection. 6012 6013 This indicates the path to a file containing the private TLS key to be used for 6014 the connection. 6015 6016 .. namedconf:statement:: cert-file 6017 :tags: server, security 6018 :short: Specifies the path to a file containing the TLS certificate for a connection. 6019 6020 This indicates the path to a file containing the TLS certificate to be used for 6021 the connection. 6022 6023 .. namedconf:statement:: ca-file 6024 :tags: server, security 6025 :short: Specifies the path to a file containing TLS certificates for trusted CA authorities, used to verify remote peer certificates. 6026 6027 This indicates the path to a file containing trusted CA authorities' TLS 6028 certificates, used to verify remote peer certificates. Specifying 6029 this option enables verification of remote peer certificates. For 6030 incoming connections, specifying this option makes BIND require 6031 a valid TLS certificate from a client. In the case of outgoing 6032 connections, if :any:`remote-hostname` is not specified, the remote 6033 server IP address is used instead. 6034 6035 .. namedconf:statement:: dhparam-file 6036 :tags: server, security 6037 :short: Specifies the path to a file containing Diffie-Hellman parameters, for enabling cipher suites. 6038 6039 This indicates the path to a file containing Diffie-Hellman parameters, 6040 which is needed to enable the cipher suites depending on the 6041 Diffie-Hellman ephemeral key exchange (DHE). Having these parameters 6042 specified is essential for enabling perfect forward secrecy capable 6043 ciphers in TLSv1.2. 6044 6045 .. namedconf:statement:: remote-hostname 6046 :tags: security 6047 :short: Specifies the expected hostname in the TLS certificate of the remote server. 6048 6049 This specifies the expected hostname in the TLS certificate of the 6050 remote server. This option enables a remote server certificate 6051 verification. If :any:`ca-file` is not specified, then the 6052 platform-specific certificates store is used for 6053 verification. This option is used when connecting to a remote peer 6054 only and, thus, is ignored when :any:`tls` statements are referenced 6055 by :any:`listen-on` or :any:`listen-on-v6` statements. 6056 6057 .. namedconf:statement:: protocols 6058 :tags: security 6059 :short: Specifies the allowed versions of the TLS protocol. 6060 6061 This specifies the allowed versions of the TLS protocol. TLS version 1.2 and higher are 6062 supported, depending on the cryptographic library in use. Multiple 6063 versions may be specified (e.g. 6064 ``protocols { TLSv1.2; TLSv1.3; };``). 6065 6066 .. namedconf:statement:: cipher-suites 6067 :tags: security 6068 :short: Specifies a list of allowed cipher suites in the order of preference for TLSv1.3 only. 6069 6070 This option defines allowed cipher suites, such as 6071 ``TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256``. 6072 The string must be formed according to the rules specified in the 6073 OpenSSL documentation (see 6074 https://docs.openssl.org/1.1.1/man1/ciphers/, section 6075 "TLS v1.3 cipher suites" for details). 6076 6077 .. namedconf:statement:: ciphers 6078 :tags: security 6079 :short: Specifies a list of allowed ciphers in the order of preference for TLSv1.2 only. 6080 6081 This option defines allowed ciphers, such as 6082 ``HIGH:!aNULL:!MD5:!SHA1:!SHA256:!SHA384``. The string must be 6083 formed according to the rules specified in the OpenSSL documentation 6084 (see https://docs.openssl.org/1.1.1/man1/ciphers/ 6085 for details). 6086 6087 .. namedconf:statement:: prefer-server-ciphers 6088 :tags: server, security 6089 :short: Specifies that server ciphers should be preferred over client ones. 6090 6091 This option specifies that server ciphers should be preferred over client ones. 6092 6093 .. namedconf:statement:: session-tickets 6094 :tags: security 6095 :short: Enables or disables session resumption through TLS session tickets. 6096 6097 This option enables or disables session resumption through TLS session tickets, 6098 as defined in :rfc:`5077`. Disabling the stateless session tickets 6099 might be required in the cases when forward secrecy is needed, 6100 or the TLS certificate and key pair is planned to be used across 6101 multiple BIND instances. 6102 6103 .. warning:: 6104 6105 TLS configuration is subject to change and incompatible changes might 6106 be introduced in the future. Users of TLS are encouraged to carefully 6107 read release notes when upgrading. 6108 6109 The options described above are used to control different aspects of 6110 TLS functioning. Thus, most of them have no well-defined default 6111 values, as these depend on the cryptographic library version in use 6112 and system-wide cryptographic policy. On the other hand, by specifying 6113 the needed options one could have a uniform configuration deployable 6114 across a range of platforms. 6115 6116 An example of privacy-oriented, perfect forward secrecy enabled 6117 configuration can be found below. It can be used as a 6118 starting point. 6119 6120 :: 6121 6122 tls local-tls { 6123 key-file "/path/to/key.pem"; 6124 cert-file "/path/to/fullchain_cert.pem"; 6125 dhparam-file "/path/to/dhparam.pem"; 6126 ciphers "HIGH:!kRSA:!aNULL:!eNULL:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!SHA1:!SHA256:!SHA384"; 6127 prefer-server-ciphers yes; 6128 session-tickets no; 6129 }; 6130 6131 A Diffie-Hellman parameters file can be generated using e.g. OpenSSL, 6132 like follows: 6133 6134 :: 6135 6136 openssl dhparam -out /path/to/dhparam.pem <3072_or_4096> 6137 6138 It is important to ensure that the file is generated on a machine with enough entropy from 6139 external sources (e.g. the local computer should be fine, 6140 the remote virtual machine or server might not be). These files do 6141 not contain any sensitive data and can be shared if required. 6142 6143 There are two built-in TLS connection configurations: ``ephemeral``, which 6144 uses a temporary key and certificate created for the current :iscman:`named` 6145 session only, and ``none``, which can be used when setting up an HTTP 6146 listener with no encryption. 6147 6148 The main motivation behind the existence of the ``ephemeral`` configuration is 6149 to aid in testing. Since trusted certificate authorities do not issue the 6150 certificates associated with this configuration, these 6151 certificates will never be trusted by any clients that verify TLS 6152 certificates; they provide encryption of the traffic but no 6153 authentication of the transmission channel. That might be enough in 6154 the case of deployment in a controlled environment. 6155 6156 It should be noted that on reconfiguration, the ``ephemeral`` TLS key 6157 and the certificate are recreated, and all TLS certificates and keys, 6158 as well as associated data, are reloaded from the disk. In that case, 6159 listening sockets associated with TLS remain intact. 6160 6161 Note that performing a reconfiguration can cause a short 6162 interruption in BIND's ability to process inbound client packets. The 6163 length of interruption is environment- and configuration-specific. A 6164 good example of when reconfiguration is necessary is when TLS keys and 6165 certificates are updated on the disk. 6166 6167 BIND supports the following TLS authentication mechanisms described in 6168 :rfc:`9103`, Section 9.3: Opportunistic TLS, Strict TLS, and Mutual 6169 TLS. 6170 6171 .. _opportunistic-tls: 6172 6173 Opportunistic TLS provides encryption for data but does not provide 6174 any authentication for the channel. This mode is the default and 6175 is used whenever the :any:`remote-hostname` and :any:`ca-file` options are not set 6176 in :any:`tls` statements in use. :rfc:`9103` allows optional fallback to 6177 clear-text DNS in the cases when TLS is not available; however, BIND 6178 intentionally does not support that fallback, to protect from 6179 unexpected data leaks due to misconfiguration. Both BIND and its 6180 complementary tools either successfully establish a secure channel via 6181 TLS when instructed to do so, or fail to establish a connection 6182 otherwise. 6183 6184 .. _strict-tls: 6185 6186 Strict TLS provides server authentication via a pre-configured 6187 hostname for outgoing connections. This mechanism offers both channel 6188 confidentiality and channel authentication (of the server). In order 6189 to achieve Strict TLS, one needs to use :any:`remote-hostname` and, optionally, 6190 :any:`ca-file` options in the :any:`tls` statements used for establishing 6191 outgoing connections (e.g. the ones used to download zone from 6192 primaries via TLS). Providing any of the mentioned options will enable 6193 server authentication. If :any:`remote-hostname` is provided but :any:`ca-file` is 6194 missing, then the platform-specific certificate authority certificates 6195 are used for authentication. The set roughly corresponds to the one 6196 used by WEB-browsers to authenticate HTTPS hosts. On the other hand, 6197 if :any:`ca-file` is provided but :any:`remote-hostname` is missing, then the 6198 remote side's IP address is used instead. 6199 6200 .. _mutual-tls: 6201 6202 Mutual TLS is an extension to Strict TLS that provides channel 6203 confidentiality and mutual channel authentication. It builds up upon 6204 the clients offering client certificates when establishing connections 6205 and them doing the server authentication as in the case of Strict 6206 TLS. The server verifies the provided client certificates and accepts 6207 the TLS connection in case of successful verification or rejects it 6208 otherwise. In order to instruct the server to require and verify 6209 client TLS certificates, one needs to specify the :any:`ca-file` option 6210 in :any:`tls` configurations used to configure server listeners. The 6211 provided file must contain certificate authority certificates used to 6212 issue client certificates. In most cases, one should build one's own 6213 TLS certificate authority specifically to issue client certificates 6214 and include the certificate authority certificate into the file. 6215 6216 For authenticating zone transfers over TLS, Mutual TLS might be 6217 considered a standalone solution, while Strict TLS paired with 6218 TSIG-based authentication and, optionally, IP-based access lists, 6219 might be considered acceptable for most practical purposes. Mutual TLS 6220 has the advantage of not requiring TSIG and thus, not having security 6221 issues related to shared cryptographic secrets. 6222 6223 :any:`http` Block Grammar 6224 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 6225 .. namedconf:statement:: http 6226 :tags: server, query 6227 :short: Configures HTTP endpoints on which to listen for DNS-over-HTTPS (DoH) queries. 6228 6229 :any:`http` Block Definition and Usage 6230 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6231 6232 The :any:`http` statement is used to configure HTTP endpoints on which 6233 to listen for DNS-over-HTTPS (DoH) queries. This configuration can 6234 then be referenced by a :any:`listen-on` or :any:`listen-on-v6` statement to 6235 cause :iscman:`named` to listen for incoming requests over HTTPS. 6236 6237 :any:`http` can only be set at the top level of :iscman:`named.conf`. 6238 6239 The following options can be specified in an :any:`http` statement: 6240 6241 .. namedconf:statement:: endpoints 6242 :tags: server, query 6243 :short: Specifies a list of HTTP query paths on which to listen. 6244 6245 This specifies a list of HTTP query paths on which to listen. This is the portion 6246 of an :rfc:`3986`-compliant URI following the hostname; it must be 6247 an absolute path, beginning with "/". The default value 6248 is ``"/dns-query"``, if omitted. 6249 6250 .. namedconf:statement:: listener-clients 6251 :tags: server, query 6252 :short: Specifies a per-listener quota for active connections. 6253 6254 This option specifies a per-listener quota for active connections. 6255 6256 .. namedconf:statement:: streams-per-connection 6257 :tags: server, query 6258 :short: Specifies the maximum number of concurrent HTTP/2 streams over an HTTP/2 connection. 6259 6260 This option specifies the hard limit on the number of concurrent 6261 HTTP/2 streams over an HTTP/2 connection. 6262 6263 Any of the options above could be omitted. In such a case, a global value 6264 specified in the :namedconf:ref:`options` statement is used 6265 (see :any:`http-listener-clients`, :any:`http-streams-per-connection`. 6266 6267 For example, the following configuration enables DNS-over-HTTPS queries on 6268 all local addresses: 6269 6270 :: 6271 6272 http local { 6273 endpoints { "/dns-query"; }; 6274 }; 6275 6276 options { 6277 .... 6278 listen-on tls ephemeral http local { any; }; 6279 listen-on-v6 tls ephemeral http local { any; }; 6280 }; 6281 6282 6283 :any:`trust-anchors` Block Grammar 6284 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6285 .. namedconf:statement:: trust-anchors 6286 :tags: dnssec 6287 :short: Defines :ref:`DNSSEC` trust anchors. 6288 6289 :any:`trust-anchors` Block Definition and Usage 6290 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6291 6292 The :any:`trust-anchors` statement defines DNSSEC trust anchors. DNSSEC is 6293 described in :ref:`DNSSEC`. 6294 6295 A trust anchor is defined when the public key or public key digest for a non-authoritative 6296 zone is known but cannot be securely obtained through DNS, either 6297 because it is the DNS root zone or because its parent zone is unsigned. 6298 Once a key or digest has been configured as a trust anchor, it is treated as if it 6299 has been validated and proven secure. 6300 6301 The resolver attempts DNSSEC validation on all DNS data in subdomains of 6302 configured trust anchors. Validation below specified names can be 6303 temporarily disabled by using :option:`rndc nta`, or permanently disabled with 6304 the :any:`validate-except` option. 6305 6306 All keys listed in :any:`trust-anchors`, and their corresponding zones, are 6307 deemed to exist regardless of what parent zones say. Only keys 6308 configured as trust anchors are used to validate the DNSKEY RRset for 6309 the corresponding name. The parent's DS RRset is not used. 6310 6311 :any:`trust-anchors` may be set at the top level of :iscman:`named.conf` or within 6312 a view. If it is set in both places, the configurations are additive; 6313 keys defined at the top level are inherited by all views, but keys 6314 defined in a view are only used within that view. 6315 6316 The :any:`trust-anchors` statement can contain 6317 multiple trust-anchor entries, each consisting of a 6318 domain name, followed by an "anchor type" keyword indicating 6319 the trust anchor's format, followed by the key or digest data. 6320 6321 If the anchor type is ``static-key`` or 6322 ``initial-key``, it is followed with the 6323 key's flags, protocol, and algorithm, plus the Base64 representation 6324 of the public key data. This is identical to the text 6325 representation of a DNSKEY record. Spaces, tabs, newlines, and 6326 carriage returns are ignored in the key data, so the 6327 configuration may be split into multiple lines. 6328 6329 If the anchor type is ``static-ds`` or 6330 ``initial-ds``, it is followed with the 6331 key tag, algorithm, digest type, and the hexadecimal 6332 representation of the key digest. This is identical to the 6333 text representation of a DS record. Spaces, tabs, newlines, 6334 and carriage returns are ignored. 6335 6336 Trust anchors configured with the 6337 ``static-key`` or ``static-ds`` 6338 anchor types are immutable, while keys configured with 6339 ``initial-key`` or ``initial-ds`` 6340 can be kept up-to-date automatically, without intervention from the resolver operator. 6341 (``static-key`` keys are identical to keys configured using the 6342 deprecated :any:`trusted-keys` statement.) 6343 6344 Suppose, for example, that a zone's key-signing key was compromised, and 6345 the zone owner had to revoke and replace the key. A resolver which had 6346 the original key 6347 configured using ``static-key`` or 6348 ``static-ds`` would be unable to validate 6349 this zone any longer; it would reply with a SERVFAIL response 6350 code. This would continue until the resolver operator had 6351 updated the :any:`trust-anchors` statement with 6352 the new key. 6353 6354 If, however, the trust anchor had been configured using 6355 ``initial-key`` or ``initial-ds`` 6356 instead, the zone owner could add a "stand-by" key to 6357 the zone in advance. :iscman:`named` would store 6358 the stand-by key, and when the original key was revoked, 6359 :iscman:`named` would be able to transition smoothly 6360 to the new key. It would also recognize that the old key had 6361 been revoked and cease using that key to validate answers, 6362 minimizing the damage that the compromised key could do. 6363 This is the process used to keep the ICANN root DNSSEC key 6364 up-to-date. 6365 6366 Whereas ``static-key`` and 6367 ``static-ds`` trust anchors continue 6368 to be trusted until they are removed from 6369 :iscman:`named.conf`, an 6370 ``initial-key`` or ``initial-ds`` 6371 is only trusted *once*: for as long as it 6372 takes to load the managed key database and start the 6373 :rfc:`5011` key maintenance process. 6374 6375 It is not possible to mix static with initial trust anchors 6376 for the same domain name. 6377 6378 The first time :iscman:`named` runs with an 6379 ``initial-key`` or ``initial-ds`` 6380 configured in :iscman:`named.conf`, it fetches the 6381 DNSKEY RRset directly from the zone apex, 6382 and validates it 6383 using the trust anchor specified in :any:`trust-anchors`. 6384 If the DNSKEY RRset is validly signed by a key matching 6385 the trust anchor, then it is used as the basis for a new 6386 managed-keys database. 6387 6388 From that point on, whenever :iscman:`named` runs, it sees the ``initial-key`` or ``initial-ds`` 6389 listed in :any:`trust-anchors`, checks to make sure :rfc:`5011` key maintenance 6390 has already been initialized for the specified domain, and if so, 6391 simply moves on. The key specified in the :any:`trust-anchors` statement is 6392 not used to validate answers; it is superseded by the key or keys stored 6393 in the managed-keys database. 6394 6395 The next time :iscman:`named` runs after an ``initial-key`` or 6396 ``initial-ds`` has been *removed* from the :any:`trust-anchors` statement 6397 (or changed to a ``static-key`` or ``static-ds``), the corresponding zone 6398 is removed from the managed-keys database, and :rfc:`5011` key maintenance 6399 is no longer used for that domain. 6400 6401 In the current implementation, the managed-keys database is stored as a 6402 master-format zone file. 6403 6404 On servers which do not use views, this file is named 6405 ``managed-keys.bind``. When views are in use, there is a separate 6406 managed-keys database for each view; the filename is the view name 6407 (or, if a view name contains characters which would make it illegal as a 6408 filename, a hash of the view name), followed by the suffix ``.mkeys``. 6409 6410 When the key database is changed, the zone is updated. As with any other 6411 dynamic zone, changes are written into a journal file, e.g., 6412 ``managed-keys.bind.jnl`` or ``internal.mkeys.jnl``. Changes are 6413 committed to the primary file as soon as possible afterward, 6414 usually within 30 seconds. Whenever :iscman:`named` is using 6415 automatic key maintenance, the zone file and journal file can be 6416 expected to exist in the working directory. (For this reason, among 6417 others, the working directory should be always be writable by 6418 :iscman:`named`.) 6419 6420 If the :any:`dnssec-validation` option is set to ``auto``, :iscman:`named` 6421 automatically sets up an ``initial-key`` for the root zone. This 6422 initializing key is built into :iscman:`named` and is current as of the 6423 release date. When the root zone key changes, a running server detects 6424 the change and rolls to the new key; however, newly installed servers being run 6425 for the first time will need to be on a recent-enough version of BIND to 6426 have been built with the current key. 6427 6428 :any:`dnssec-policy` Block Grammar 6429 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6430 .. namedconf:statement:: dnssec-policy 6431 :tags: dnssec 6432 :short: Defines a key and signing policy (KASP) for zones. 6433 6434 :any:`dnssec-policy` Block Definition and Usage 6435 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6436 6437 The :any:`dnssec-policy` statement defines a key and signing policy (KASP) 6438 for zones. 6439 6440 A KASP determines how one or more zones are signed with DNSSEC. For 6441 example, it specifies how often keys should roll, which cryptographic 6442 algorithms to use, and how often RRSIG records need to be refreshed. 6443 Multiple key and signing policies can be configured with unique policy names. 6444 6445 A policy for a zone is selected using a :any:`dnssec-policy` statement in the 6446 :namedconf:ref:`zone` block, specifying the name of the policy that should be 6447 used. 6448 6449 There are three built-in policies: 6450 - ``default``, which uses the :ref:`default policy <dnssec_policy_default>`; 6451 - ``insecure``, to be used when the zone should be unsigned gracefully; and 6452 - ``none``, which means no DNSSEC policy (the same as not selecting 6453 :any:`dnssec-policy` at all; the zone is not signed). 6454 6455 Keys are not shared among zones, which means that one set of keys per 6456 zone is generated even if they have the same policy. If multiple views 6457 are configured with different versions of the same zone, each separate 6458 version uses the same set of signing keys. 6459 6460 If the expected key files that were previously observed have gone missing or 6461 are inaccessible, key management is halted. This will prevent rollovers 6462 from being started if there is a temporary file access issue. If his problem 6463 is permanent it will eventually lead to expired signatures in your zone. 6464 Note that if the key files are missing or inaccessible during :iscman:`named` 6465 startup, BIND 9 will try to generate new keys according to the DNSSEC policy, 6466 because it has no cached information about existing keys yet. 6467 6468 The :any:`dnssec-policy` statement requires dynamic DNS to be set up, or 6469 :any:`inline-signing` to be enabled (which is the default for DNSSEC zones). 6470 6471 If :any:`inline-signing` is enabled, this means that a signed version of the 6472 zone is maintained separately and is written out to a different file on disk 6473 (the zone's filename plus a ``.signed`` extension). 6474 6475 If :any:`inline-signing` is disabled, the zone needs to be configured with 6476 an :any:`update-policy` or :any:`allow-update`. In such a case, the DNSSEC 6477 records are written to the filename set in the original zone's :any:`file`. 6478 6479 Key rollover timing is computed for each key according to the key 6480 lifetime defined in the KASP. The lifetime may be modified by zone TTLs 6481 and propagation delays, to prevent validation failures. When a key 6482 reaches the end of its lifetime, :iscman:`named` generates and publishes a new 6483 key automatically, then deactivates the old key and activates the new 6484 one; finally, the old key is retired according to a computed schedule. 6485 6486 Zone-signing key (ZSK) rollovers require no operator input. Key-signing 6487 key (KSK) and combined-signing key (CSK) rollovers require action to be 6488 taken to submit a DS record to the parent. Rollover timing for KSKs and 6489 CSKs is adjusted to take into account delays in processing and 6490 propagating DS updates. 6491 6492 .. _dnssec_policy_default: 6493 6494 The policy ``default`` causes the zone to be signed with a single combined-signing 6495 key (CSK) using the algorithm ECDSAP256SHA256; this key has an unlimited 6496 lifetime. This policy can be displayed using the command :option:`named -C`. 6497 6498 .. note:: The default signing policy may change in future releases. 6499 This could require changes to a signing policy when upgrading to a 6500 new version of BIND. Check the release notes carefully when 6501 upgrading to be informed of such changes. To prevent policy changes 6502 on upgrade, use an explicitly defined :any:`dnssec-policy`, rather than 6503 ``default``. 6504 6505 If a :any:`dnssec-policy` statement is modified and the server restarted or 6506 reconfigured, :iscman:`named` attempts to change the policy smoothly from the 6507 old one to the new. For example, if the key algorithm is changed, then 6508 a new key is generated with the new algorithm, and the old algorithm is 6509 retired when the existing key's lifetime ends. 6510 6511 .. note:: Rolling to a new policy while another key rollover is already 6512 in progress is not yet supported, and may result in unexpected 6513 behavior. 6514 6515 The following options can be specified in a :any:`dnssec-policy` statement: 6516 6517 .. namedconf:statement:: cdnskey 6518 :tags: dnssec 6519 :short: Specifies whether a CDNSKEY record should be published during KSK rollover. 6520 6521 When set to the default value of ``yes``, a CDNSKEY record is published 6522 during KSK rollovers when the DS of the successor key may be submitted to 6523 the parent. 6524 6525 .. namedconf:statement:: cds-digest-types 6526 :tags: dnssec 6527 :short: Specifies the digest types to use for CDS resource records. 6528 6529 This indicates the digest types to use when generating CDS resource 6530 records. The default is SHA-256 only. 6531 6532 .. namedconf:statement:: dnskey-ttl 6533 :tags: dnssec 6534 :short: Specifies the time-to-live (TTL) for DNSKEY resource records. 6535 6536 This indicates the TTL to use when generating DNSKEY resource 6537 records. The default is 1 hour (3600 seconds). 6538 6539 .. _dnssec-policy-inline-signing: 6540 6541 inline-signing 6542 :tags: dnssec 6543 :short: Specifies whether BIND 9 maintains a separate signed version of a zone. 6544 6545 If ``yes``, BIND 9 maintains a separate signed version of the zone. 6546 An unsigned zone is transferred in or loaded from disk and the signed 6547 version of the zone is served with, possibly, a different serial 6548 number. The signed version of the zone is stored in a file that is 6549 the zone's filename (set in :any:`file`) with a ``.signed`` extension. 6550 6551 This behavior is enabled by default. 6552 6553 .. _dnssec-policy-keys: 6554 6555 keys 6556 :tags: dnssec 6557 :short: Specifies the type of keys to be used for DNSSEC signing. 6558 6559 This is a list specifying the algorithms and roles to use when 6560 generating keys and signing the zone. Entries in this list do not 6561 represent specific DNSSEC keys, which may be changed on a regular 6562 basis, but the roles that keys play in the signing policy. For 6563 example, configuring a KSK of algorithm RSASHA256 ensures that the 6564 DNSKEY RRset always includes a key-signing key for that algorithm. 6565 6566 Here is an example (for illustration purposes only) of some possible 6567 entries in a ``keys`` list: 6568 6569 :: 6570 6571 keys { 6572 ksk key-directory lifetime unlimited algorithm rsasha256 2048; 6573 zsk lifetime 30d algorithm 8 tag-range 0 32767; 6574 csk key-store "hsm" lifetime P6MT12H3M15S algorithm ecdsa256; 6575 }; 6576 6577 This example specifies that three keys should be used in the zone. 6578 The first token determines which role the key plays in signing 6579 RRsets. If set to ``ksk``, then this is a key-signing key; it has 6580 the KSK flag set and is only used to sign DNSKEY, CDS, and CDNSKEY 6581 RRsets. If set to ``zsk``, this is a zone-signing key; the KSK flag 6582 is unset, and the key signs all RRsets *except* DNSKEY, CDS, and 6583 CDNSKEY. If set to ``csk``, the key has the KSK flag set and is 6584 used to sign all RRsets. 6585 6586 An optional second token determines where the key is stored. 6587 The two available options are ``key-store <string>`` and 6588 ``key-directory``. 6589 6590 When using ``key-store``, the referenced :any:`key-store` describes 6591 how the key should be be stored. This can be as a file, or it can be 6592 inside a PKCS#11 token. 6593 6594 When using ``key-directory``, the key is stored in the zone's 6595 configured :any:`key-directory`. This is also the default. 6596 6597 When using ``tag-range``, valid key tags for managed keys are 6598 restricted to this range [``tag-min`` ``tag-max``]. The optional 6599 ``tag-range`` is intended to be used in multi-signer scenarios. 6600 The default is unlimited ([0..65535]). 6601 6602 The ``lifetime`` parameter specifies how long a key may be used 6603 before rolling over. For convenience, TTL-style time-unit suffixes 6604 can be used to specify the key lifetime. It also accepts ISO 8601 6605 duration formats. 6606 6607 In the example above, the first key has an 6608 unlimited lifetime, the second key may be used for 30 days, and the 6609 third key has a rather peculiar lifetime of 6 months, 12 hours, 3 6610 minutes, and 15 seconds. A lifetime of 0 seconds is the same as 6611 ``unlimited``. 6612 6613 Note that the lifetime of a key may be extended if retiring it too 6614 soon would cause validation failures. The key lifetime must be 6615 longer than the time it takes to do a rollover; that is, the lifetime 6616 must be more than the publication interval (which is the sum of 6617 :any:`dnskey-ttl`, :any:`publish-safety`, and :any:`zone-propagation-delay`). 6618 It must also be more than the retire interval (which is the sum of 6619 :any:`max-zone-ttl`, :any:`retire-safety`, :any:`zone-propagation-delay`, 6620 and signing delay (:any:`signatures-validity` minus 6621 :any:`signatures-refresh`) for ZSKs, and the sum of :any:`parent-ds-ttl`, 6622 :any:`retire-safety`, and :any:`parent-propagation-delay` for KSKs and 6623 CSKs). BIND 9 treats a key lifetime that is too short as an error. 6624 6625 The ``algorithm`` parameter specifies the key's algorithm, expressed 6626 either as a string ("rsasha256", "ecdsa384", etc.) or as a decimal 6627 number. An optional second parameter specifies the key's size in 6628 bits. If it is omitted, as shown in the example for the second and 6629 third keys, an appropriate default size for the algorithm is used. 6630 Each KSK/ZSK pair must have the same algorithm. A CSK combines the 6631 functionality of a ZSK and a KSK. 6632 6633 .. note:: When changing the ``key-directory`` or the ``key-store``, BIND will 6634 be unable to find existing key files. Be sure to copy key files to the 6635 new directory before changing the path used in the configuration file. 6636 This is also true when changing to a built-in policy, e.g. to 6637 ``insecure``. In this specific case, the existing key files should be moved 6638 to the zone's ``key-directory`` from the new configuration. 6639 6640 .. namedconf:statement:: manual-mode 6641 :tags: dnssec 6642 :short: Run key management in a manual mode. 6643 6644 If enabled, BIND 9 does not automatically start and progress key rollovers, 6645 instead the change is logged. Only after manual confirmation with 6646 :option:`rndc dnssec -step <rndc dnssec>` the change is made. 6647 6648 This feature is off by default. 6649 6650 .. namedconf:statement:: offline-ksk 6651 :tags: dnssec 6652 :short: Specifies whether the DNSKEY, CDS, and CDNSKEY RRsets are being signed offline. 6653 6654 If enabled, BIND 9 does not generate signatures for the DNSKEY, CDS, and 6655 CDNSKEY RRsets. Instead, the signed DNSKEY, CDS and CDNSKEY RRsets are 6656 looked up from Signed Key Response (SKR) files. 6657 6658 Any existing DNSKEY, CDS, and CDNSKEY RRsets in the unsigned version of the 6659 zone are filtered and replaced with RRsets from the SKR file. 6660 6661 This feature is off by default. Configuring ``offline-ksk`` in conjunction 6662 with a CSK is a configuration error. 6663 6664 .. namedconf:statement:: purge-keys 6665 :tags: dnssec 6666 :short: Specifies the amount of time after which DNSSEC keys that have been deleted from the zone can be removed from disk. 6667 6668 This is the amount of time after which DNSSEC keys that have been deleted from 6669 the zone can be removed from disk. If a key still determined to have 6670 presence (for example in some resolver cache), :iscman:`named` will not 6671 remove the key files. 6672 6673 The default is ``P90D`` (90 days). Set this option to ``0`` to never 6674 purge deleted keys. 6675 6676 .. namedconf:statement:: publish-safety 6677 :tags: dnssec 6678 :short: Increases the amount of time between when keys are published and when they become active, to allow for unforeseen events. 6679 6680 This is a margin that is added to the pre-publication interval in 6681 rollover timing calculations, to give some extra time to cover 6682 unforeseen events. This increases the time between when keys are 6683 published and when they become active. The default is ``PT1H`` (1 6684 hour). 6685 6686 .. namedconf:statement:: retire-safety 6687 :tags: dnssec 6688 :short: Increases the amount of time a key remains published after it is no longer active, to allow for unforeseen events. 6689 6690 This is a margin that is added to the post-publication interval in 6691 rollover timing calculations, to give some extra time to cover 6692 unforeseen events. This increases the time a key remains published 6693 after it is no longer active. The default is ``PT1H`` (1 hour). 6694 6695 .. namedconf:statement:: signatures-jitter 6696 :tags: dnssec 6697 :short: Specifies a range for signature expirations. 6698 6699 To prevent all signatures from expiring at the same moment, BIND 9 may 6700 vary the validity interval of individual signatures. The validity of a 6701 newly generated signature is in the range between :any:`signatures-validity` 6702 (maximum) and :any:`signatures-validity`, minus :any:`signatures-jitter` 6703 (minimum). The default jitter is 12 hours, and the configured value must 6704 be lower than both :any:`signatures-validity` and 6705 :any:`signatures-validity-dnskey`. 6706 6707 .. namedconf:statement:: signatures-refresh 6708 :tags: dnssec 6709 :short: Specifies how frequently an RRSIG record is refreshed. 6710 6711 This determines how frequently an RRSIG record needs to be 6712 refreshed. The signature is renewed when the time until the 6713 expiration time is less than the specified interval. The default is 6714 ``P5D`` (5 days), meaning signatures that expire in 5 days or sooner 6715 are refreshed. The :any:`signatures-refresh` value must be less than 6716 90% of the minimum value of :any:`signatures-validity` and 6717 :any:`signatures-validity-dnskey`. 6718 6719 .. namedconf:statement:: signatures-validity 6720 :tags: dnssec 6721 :short: Indicates the validity period of an RRSIG record. 6722 6723 This indicates the validity period of an RRSIG record (subject to 6724 inception offset and jitter). The default is ``P2W`` (2 weeks). 6725 6726 The :any:`signatures-validity` should be at least several multiples 6727 of the SOA expire interval, to allow for reasonable interaction between 6728 the various timer and expiry dates. 6729 6730 .. namedconf:statement:: signatures-validity-dnskey 6731 :tags: dnssec 6732 :short: Indicates the validity period of DNSKEY records. 6733 6734 This is similar to :any:`signatures-validity`, but for DNSKEY records. 6735 The default is ``P2W`` (2 weeks). 6736 6737 .. _dnssec-policy-max-zone-ttl: 6738 6739 max-zone-ttl 6740 :tags: zone, query 6741 :short: Specifies a maximum permissible time-to-live (TTL) value, in seconds. 6742 6743 This specifies the maximum permissible TTL value for the zone. When 6744 a zone file is loaded, any record encountered with a TTL higher than 6745 :any:`max-zone-ttl` causes the zone to be rejected. 6746 6747 This ensures that when rolling to a new DNSKEY, the old key will remain 6748 available until RRSIG records have expired from caches. The 6749 :any:`max-zone-ttl` option guarantees that the largest TTL in the 6750 zone is no higher than a known and predictable value. 6751 6752 The default value ``PT24H`` (24 hours). A value of zero is treated 6753 as if the default value were in use. 6754 6755 .. namedconf:statement:: nsec3param 6756 :tags: dnssec 6757 :short: Specifies the use of NSEC3 instead of NSEC, and sets NSEC3 parameters. 6758 6759 Use NSEC3 instead of NSEC, and optionally set the NSEC3 parameters. 6760 6761 Here is an example of an ``nsec3`` configuration: 6762 6763 :: 6764 6765 nsec3param iterations 0 optout no salt-length 0; 6766 6767 The default is to use :ref:`NSEC`. The ``iterations``, ``optout``, and 6768 ``salt-length`` parts are optional, but if not set, the values in 6769 the example above are the default :ref:`NSEC3` parameters. Note that the 6770 specific salt string is not specified by the user; :iscman:`named` creates a salt 6771 of the indicated length. 6772 6773 .. warning:: 6774 Do not use extra :term:`iterations <Iterations>`, :term:`salt <Salt>`, and 6775 :term:`opt-out <Opt-out>` unless their implications are fully understood. 6776 A higher number of iterations causes interoperability problems and opens 6777 servers to CPU-exhausting DoS attacks. See :rfc:`9276`. 6778 6779 .. namedconf:statement:: zone-propagation-delay 6780 :tags: dnssec, zone 6781 :short: Sets the propagation delay from the time a zone is first updated to when the new version of the zone is served by all secondary servers. 6782 6783 This is the expected propagation delay from the time when a zone is 6784 first updated to the time when the new version of the zone is served 6785 by all secondary servers. The default is ``PT5M`` (5 minutes). 6786 6787 .. namedconf:statement:: parent-ds-ttl 6788 :tags: dnssec 6789 :short: Sets the time to live (TTL) of the DS RRset used by the parent zone. 6790 6791 This is the TTL of the DS RRset that the parent zone uses. The 6792 default is ``P1D`` (1 day). 6793 6794 .. namedconf:statement:: parent-propagation-delay 6795 :tags: dnssec, zone 6796 :short: Sets the propagation delay from the time the parent zone is updated to when the new version is served by all of the parent zone's name servers. 6797 6798 This is the expected propagation delay from the time when the parent 6799 zone is updated to the time when the new version is served by all of 6800 the parent zone's name servers. The default is ``PT1H`` (1 hour). 6801 6802 Automated KSK Rollovers 6803 ^^^^^^^^^^^^^^^^^^^^^^^ 6804 6805 BIND has mechanisms in place to facilitate automated KSK rollovers. It 6806 publishes CDS and CDNSKEY records that can be used by the parent zone to 6807 publish or withdraw the zone's DS records. BIND will query the parental 6808 agents to see if the new DS is actually published before withdrawing the 6809 old DNSSEC key. 6810 6811 .. note:: 6812 The DS response is not validated so it is recommended to set up a 6813 trust relationship with the parental agent. For example, use TSIG to 6814 authenticate the parental agent, or point to a validating resolver. 6815 6816 .. namedconf:statement:: parental-agents 6817 :tags: dnssec 6818 6819 This specifies a list of one or more IP addresses of parental agents that 6820 are used to query the zone's DS records during a KSK rollover. The list of 6821 parental agents can also contain the names of :any:`remote-servers` blocks. 6822 6823 By default, DS queries are sent from port 53 on the servers; this can be 6824 changed for all servers by specifying a port number before the list of IP 6825 addresses, or on a per-server basis after the IP address. Authentication to 6826 the primary can also be done with per-server TSIG keys. 6827 6828 The following options apply to DS queries sent to :any:`parental-agents`: 6829 6830 .. namedconf:statement:: checkds 6831 :tags: dnssec 6832 :short: Controls whether ``DS`` queries are sent to parental agents. 6833 6834 If set to ``yes``, DS queries are sent when a KSK rollover is in progress. 6835 The queries are sent to the servers listed in the parent zone's NS records. 6836 This is the default if there are no :any:`parental-agents` configured for 6837 the zone. 6838 6839 If set to ``explicit``, DS queries are sent only to servers explicitly listed 6840 using :any:`parental-agents`. This is the default if there are parental 6841 agents configured. 6842 6843 If set to ``no``, no DS queries are sent. Users should manually run 6844 :option:`rndc dnssec -checkds <rndc dnssec>` with the appropriate parameters, 6845 to signal that specific DS records are published and/or withdrawn. 6846 6847 .. namedconf:statement:: parental-source 6848 :tags: dnssec 6849 :short: Specifies which local IPv4 source address is used to send parental DS queries. 6850 6851 :any:`parental-source` determines which local source address, and optionally 6852 UDP port, is used to send parental DS queries. This statement sets the 6853 :any:`parental-source` for all zones, but can be overridden on a per-zone or 6854 per-view basis by including a :any:`parental-source` statement within the 6855 :any:`zone` or :any:`view` block in the configuration file. 6856 6857 .. note:: ``port`` configuration is deprecated. A warning will be logged 6858 when this parameter is used. 6859 6860 .. warning:: Specifying a single port is discouraged, as it removes a layer of 6861 protection against spoofing errors. 6862 6863 .. warning:: The configured :term:`port` must not be the same as the listening port. 6864 6865 .. namedconf:statement:: parental-source-v6 6866 :tags: dnssec 6867 :short: Specifies which local IPv6 source address is used to send parental DS queries. 6868 6869 This option acts like :any:`parental-source`, but applies to parental DS 6870 queries sent to IPv6 addresses. 6871 6872 :any:`managed-keys` Block Grammar 6873 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6874 .. namedconf:statement:: managed-keys 6875 :tags: deprecated 6876 6877 :any:`managed-keys` Block Definition and Usage 6878 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6879 6880 The :any:`managed-keys` statement has been 6881 deprecated in favor of :any:`trust-anchors` 6882 with the ``initial-key`` keyword. 6883 6884 :any:`trusted-keys` Block Grammar 6885 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6886 .. namedconf:statement:: trusted-keys 6887 :tags: deprecated 6888 6889 :any:`trusted-keys` Block Definition and Usage 6890 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6891 6892 The :any:`trusted-keys` statement has been deprecated in favor of 6893 :any:`trust-anchors` with the ``static-key`` keyword. 6894 6895 :any:`view` Block Grammar 6896 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 6897 .. namedconf:statement:: view 6898 :tags: view 6899 :short: Allows a name server to answer a DNS query differently depending on who is asking. 6900 6901 :: 6902 6903 view view_name [ class ] { 6904 match-clients { address_match_list } ; 6905 match-destinations { address_match_list } ; 6906 match-recursive-only <boolean> ; 6907 [ view_option ; ... ] 6908 [ zone_statement ; ... ] 6909 } ; 6910 6911 :any:`view` Block Definition and Usage 6912 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6913 6914 The :any:`view` statement is a powerful feature of BIND 9 that lets a name 6915 server answer a DNS query differently depending on who is asking. It is 6916 particularly useful for implementing split DNS setups without having to 6917 run multiple servers. 6918 6919 .. namedconf:statement:: match-clients 6920 :tags: view 6921 :short: Specifies a view of DNS namespace for a given subset of client IP addresses. 6922 6923 .. namedconf:statement:: match-destinations 6924 :tags: view 6925 :short: Specifies a view of DNS namespace for a given subset of destination IP addresses. 6926 6927 Each :any:`view` statement defines a view of the DNS namespace that is 6928 seen by a subset of clients. A client matches a view if its source IP 6929 address matches the :term:`address_match_list` of the view's 6930 :any:`match-clients` clause, and its destination IP address matches the 6931 :term:`address_match_list` of the view's :any:`match-destinations` clause. If 6932 not specified, both :any:`match-clients` and :any:`match-destinations` default 6933 to matching all addresses. In addition to checking IP addresses, 6934 :any:`match-clients` and :any:`match-destinations` can also take the name of a 6935 TSIG :namedconf:ref:`key`, which provides a mechanism for the client to select 6936 the view. 6937 6938 .. namedconf:statement:: match-recursive-only 6939 :tags: view 6940 :short: Specifies that only recursive requests can match this view of the DNS namespace. 6941 6942 A view can 6943 also be specified as :any:`match-recursive-only`, which means that only 6944 recursive requests from matching clients match that view. The order 6945 of the :any:`view` statements is significant; a client request is 6946 resolved in the context of the first :any:`view` that it matches. 6947 6948 Zones defined within a :any:`view` statement are only accessible to 6949 clients that match the :any:`view`. By defining a zone of the same name in 6950 multiple views, different zone data can be given to different clients: 6951 for example, "internal" and "external" clients in a split DNS setup. 6952 6953 Many of the options given in the :namedconf:ref:`options` statement can also be used 6954 within a :any:`view` statement, and then apply only when resolving queries 6955 with that view. When no view-specific value is given, the value in the 6956 :namedconf:ref:`options` statement is used as a default. Also, zone options can have 6957 default values specified in the :any:`view` statement; these view-specific 6958 defaults take precedence over those in the :namedconf:ref:`options` statement. 6959 6960 Views are class-specific. If no class is given, class IN is assumed. 6961 Note that all non-IN views must contain a hint zone, since only the IN 6962 class has compiled-in default hints. 6963 6964 If there are no :any:`view` statements in the config file, a default view 6965 that matches any client is automatically created in class IN. Any 6966 :any:`zone` statements specified on the top level of the configuration file 6967 are considered to be part of this default view, and the :namedconf:ref:`options` 6968 statement applies to the default view. If any explicit :any:`view` 6969 statements are present, all :any:`zone` statements must occur inside 6970 :any:`view` statements. 6971 6972 Here is an example of a typical split DNS setup implemented using 6973 :any:`view` statements: 6974 6975 :: 6976 6977 view "internal" { 6978 // This should match our internal networks. 6979 match-clients { 10.0.0.0/8; }; 6980 6981 // Provide recursive service to internal 6982 // clients only. 6983 recursion yes; 6984 6985 // Provide a complete view of the example.com 6986 // zone including addresses of internal hosts. 6987 zone "example.com" { 6988 type primary; 6989 file "example-internal.db"; 6990 }; 6991 }; 6992 6993 view "external" { 6994 // Match all clients not matched by the 6995 // previous view. 6996 match-clients { any; }; 6997 6998 // Refuse recursive service to external clients. 6999 recursion no; 7000 7001 // Provide a restricted view of the example.com 7002 // zone containing only publicly accessible hosts. 7003 zone "example.com" { 7004 type primary; 7005 file "example-external.db"; 7006 }; 7007 }; 7008 7009 :any:`zone` Block Grammar 7010 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 7011 .. namedconf:statement:: zone 7012 :tags: zone 7013 :short: Specifies the zone in a BIND 9 configuration. 7014 :suppress_grammar: 7015 7016 :any:`zone` Block Definition and Usage 7017 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7018 7019 Zone Types 7020 ^^^^^^^^^^ 7021 .. namedconf:statement:: type 7022 :tags: zone 7023 :short: Specifies the kind of zone in a given configuration. 7024 :suppress_grammar: 7025 7026 The :any:`type` keyword is required for the :any:`zone` configuration unless 7027 it is an :any:`in-view` configuration. Its acceptable values are: 7028 :any:`primary <type primary>` (or ``master``), :any:`secondary <type 7029 secondary>` (or ``slave``), :any:`mirror <type mirror>`, :any:`hint <type 7030 hint>`, :any:`stub <type stub>`, :any:`static-stub <type static-stub>`, 7031 :any:`forward <type forward>`, or :any:`redirect <type redirect>`. 7032 7033 .. namedconf:statement:: type primary 7034 :tags: zone 7035 :short: Contains the main copy of the data for a zone. 7036 7037 A primary zone has a master copy of the data for the zone and is able 7038 to provide authoritative answers for it. Type ``master`` is a synonym 7039 for :any:`primary <type primary>`. 7040 7041 .. namedconf:statement:: type secondary 7042 :tags: zone 7043 :short: Contains a duplicate of the data for a zone that has been transferred from a primary server. 7044 7045 A secondary zone is a replica of a primary zone. Type ``slave`` is a 7046 synonym for :any:`secondary <type secondary>`. The :any:`primaries` list 7047 specifies one or more IP addresses of primary servers that the secondary 7048 contacts to update its copy of the zone. 7049 7050 A zone may refresh on timer or on receipt of a notify. If a valid notify is 7051 received where the notify carries a serial number larger than the one in the 7052 SOA currently served, then the secondary will schedule a zone refresh. 7053 7054 A notify is considered valid if the sender is one of the servers in the NS 7055 RRset for the zone, has been explicitly allowed using an :any:`allow-notify` 7056 clause, or is from an address listed in the primary servers clause. 7057 7058 If no notifies have been received, the server will try to refresh the zone. 7059 The REFRESH field in the SOA record determines how long after the last zone 7060 update it should query the primaries for the SOA record. Again, if the 7061 SOA record contains a serial number larger than the one in the SOA currently 7062 served, a zone refresh is scheduled. If a notify is received while a 7063 refresh is in progress, the serial number of the notify is checked and if 7064 it is larger, another refresh for the zone is queued. There will at most 7065 be one zone refresh queued. 7066 7067 The primary servers are queried in turn, :any:`named` will move on to the 7068 next server in the list if either it is unable to get a valid response from 7069 the server it is currently querying, or the primary being queried returns 7070 the same or smaller SOA than the secondary is currently serving. On the 7071 first SOA received that has a serial bigger than the one currently served, 7072 :any:`named` will initiate a zone transfer with that server. Once the zone 7073 transfer has been received and the zone has been updated, then this zone 7074 refresh is complete, and no other servers are tried. 7075 7076 When receiving a notify, :any:`named` does not first query the sender of 7077 the notify. It will continue with the next server in the list that 7078 transferred the zone, skipping over unreachable servers. A primary is 7079 considered unreachable if the secondary cannot get a response from the 7080 server. This state will be cached for 10 minutes, or until a notify is 7081 received from that address. 7082 7083 Furthermore, a zone is refreshed when the secondary server is restarted, 7084 or when a :option:`rndc refresh <rndc refresh>` command is received. 7085 7086 If a file is specified, then the replica is written to this file whenever the zone 7087 is changed, and reloaded from this file on a server restart. Use of a file 7088 is recommended, since it often speeds server startup and eliminates a 7089 needless waste of bandwidth. Note that for large numbers (in the tens or 7090 hundreds of thousands) of zones per server, it is best to use a two-level 7091 naming scheme for zone filenames. For example, a secondary server for the 7092 zone ``example.com`` might place the zone contents into a file called 7093 ``ex/example.com``, where ``ex/`` is just the first two letters of the zone 7094 name. (Most operating systems behave very slowly if there are 100,000 files 7095 in a single directory.) 7096 7097 .. namedconf:statement:: type mirror 7098 :tags: zone 7099 :short: Contains a DNSSEC-validated duplicate of the main data for a zone. 7100 7101 A mirror zone is similar to a zone of :any:`type secondary`, except its 7102 data is subject to DNSSEC validation before being used in answers. 7103 Validation is applied to the entire zone during the zone transfer 7104 process, and again when the zone file is loaded from disk upon 7105 restarting :iscman:`named`. If validation of a new version of a mirror zone 7106 fails, a retransfer is scheduled; in the meantime, the most recent 7107 correctly validated version of that zone is used until it either 7108 expires or a newer version validates correctly. If no usable zone 7109 data is available for a mirror zone, due to either transfer failure 7110 or expiration, traditional DNS recursion is used to look up the 7111 answers instead. Mirror zones cannot be used in a view that does not 7112 have recursion enabled. 7113 7114 Answers coming from a mirror zone look almost exactly like answers 7115 from a zone of :any:`type secondary`, with the notable exceptions that 7116 the AA bit ("authoritative answer") is not set, and the AD bit 7117 ("authenticated data") is. 7118 7119 Mirror zones are intended to be used to set up a fast local copy of 7120 the root zone (see :rfc:`8806`). A default list of primary servers 7121 for the IANA root zone is built into :iscman:`named`, so its mirroring can 7122 be enabled using the following configuration: 7123 7124 :: 7125 7126 zone "." { 7127 type mirror; 7128 }; 7129 7130 Mirror zone validation always happens for the entire zone contents. 7131 This ensures that each version of the zone used by the resolver is 7132 fully self-consistent with respect to DNSSEC. For incoming mirror 7133 zone IXFRs, every revision of the zone contained in the IXFR sequence 7134 is validated independently, in the order in which the zone revisions 7135 appear on the wire. For this reason, it might be useful to force use 7136 of AXFR for mirror zones by setting ``request-ixfr no;`` for the 7137 relevant zone (or view). Other, more efficient zone verification 7138 methods may be added in the future. 7139 7140 To make mirror zone contents persist between :iscman:`named` restarts, use 7141 the :any:`file` option. 7142 7143 Mirroring a zone other than root requires an explicit list of primary 7144 servers to be provided using the :any:`primaries` option (see 7145 :any:`primaries` for details), and a key-signing key (KSK) 7146 for the specified zone to be explicitly configured as a trust anchor 7147 (see :any:`trust-anchors`). 7148 7149 When configuring NOTIFY for a mirror zone, only ``notify no;`` and 7150 ``notify explicit;`` can be used at the zone level; any other 7151 :namedconf:ref:`notify` setting at the zone level is a configuration error. Using 7152 any other :namedconf:ref:`notify` setting at the :namedconf:ref:`options` or :any:`view` level 7153 causes that setting to be overridden with ``notify explicit;`` for 7154 the mirror zone. The global default for the :namedconf:ref:`notify` option is 7155 ``yes``, so mirror zones are by default configured with ``notify 7156 explicit;``. 7157 7158 Outgoing transfers of mirror zones are disabled by default but may be 7159 enabled using :any:`allow-transfer`. 7160 7161 .. note:: 7162 Use of this zone type with any zone other than the root should be 7163 considered *experimental* and may cause performance issues, 7164 especially for zones that are large and/or frequently updated. 7165 7166 .. namedconf:statement:: type hint 7167 :tags: zone 7168 :short: Contains the initial set of root name servers to be used at BIND 9 startup. 7169 7170 The initial set of root name servers is specified using a hint zone. 7171 When the server starts, it uses the root hints to find a root name 7172 server and get the most recent list of root name servers. If no hint zone 7173 is specified for class IN, the server uses a compiled-in default set of 7174 root servers hints. Classes other than IN have no built-in default hints. 7175 7176 .. namedconf:statement:: type stub 7177 :tags: zone 7178 :short: Contains a duplicate of the NS records of a zone. 7179 7180 A stub zone specifies a set of name servers to use when contacting the zone 7181 for the first time. A stub zone overrides any NS records (delegations) 7182 that might exist in the parent zone. Once an authoritative server is 7183 reached, the NS records from that server are honored. 7184 7185 A stub zone can work around missing or broken delegations, but comes at 7186 expense of maintaining a set of name server addresses in 7187 :iscman:`named.conf`. 7188 7189 .. warning:: Use of stub zones is not recommended. Proper delegation 7190 with NS records in the parent zone should be used. 7191 7192 7193 :iscman:`named` queries authoritative servers configured as :any:`primaries` 7194 to obtain up-to-date NS records. These new NS records are then used 7195 to obtain answers from a given zone. 7196 7197 Stub zones can also be used as a way to force the resolution of a given 7198 domain to use a particular set of authoritative servers. For example, the 7199 caching name servers on a private network using :rfc:`1918` addressing may be 7200 configured with stub zones for ``10.in-addr.arpa`` to use a set of 7201 internal name servers as the authoritative servers for that domain. 7202 7203 If a BIND 9 primary, serving a parent zone, has child stub zones configured, 7204 all the secondary servers for the parent zone also need to have the same 7205 child stub zones configured. 7206 7207 Stub zones are not a standard part of the DNS; they are a feature specific 7208 to the BIND implementation. 7209 7210 7211 .. namedconf:statement:: type static-stub 7212 :tags: zone 7213 :short: Contains statically configured NS records for a zone. 7214 7215 A static-stub zone specifies a set of name servers to use to resolve *all* 7216 queries for the given zone. A stub zone overrides any NS records 7217 (delegations) that might exist in the parent zone, and also any records 7218 received from the otherwise-authoritative server. 7219 7220 Like a :any:`stub <type stub>` zone, this can work around missing or broken 7221 delegations at the parent. Unlike stub, static-stub also overrides any NS 7222 records offered by the specified servers. 7223 7224 When recursion is necessary for a query that matches a static-stub zone, 7225 the locally configured data (name server names and glue addresses) is 7226 always used, even if different authoritative information is cached. 7227 7228 The zone data is configured via the :any:`server-addresses` and 7229 :any:`server-names` zone statements. These must point to authoritative 7230 servers. 7231 7232 .. warning:: Use of static-stub zones is not recommended. Proper delegation 7233 with NS records in the parent zone should be used. 7234 7235 The zone data is maintained in the form of NS and (if necessary) glue A or 7236 AAAA RRs internally, which can be seen by dumping zone databases with 7237 :option:`rndc dumpdb -all <rndc dumpdb>`. The configured RRs are considered local configuration 7238 parameters rather than public data. Non-recursive queries (i.e., those 7239 with the RD bit off) to a static-stub zone are therefore prohibited and 7240 are responded to with REFUSED. 7241 7242 Since the data is statically configured, no zone maintenance action takes 7243 place for a static-stub zone. For example, there is no periodic refresh 7244 attempt, and an incoming :ref:`NOTIFY <notify>` message is rejected with an rcode 7245 of NOTAUTH. 7246 7247 Each static-stub zone is configured with internally generated NS and (if 7248 necessary) glue A or AAAA RRs. 7249 7250 .. namedconf:statement:: type forward 7251 :tags: zone 7252 :short: Contains forwarding statements that apply to queries within a given domain. 7253 7254 A forward zone is a way to configure forwarding on a per-domain basis. 7255 A :any:`zone` statement of type :any:`forward` can contain a :any:`forward` and/or 7256 :any:`forwarders` statement, which applies to queries within the domain 7257 given by the zone name. If no :any:`forwarders` statement is present, or an 7258 empty list for :any:`forwarders` is given, then no forwarding is done 7259 for the domain, canceling the effects of any forwarders in the :namedconf:ref:`options` 7260 statement. Thus, to use this type of zone to change the 7261 behavior of the global :any:`forward` option (that is, "forward first" to, 7262 then "forward only", or vice versa), but use the same servers as set 7263 globally, re-specify the global forwarders. 7264 7265 .. namedconf:statement:: type redirect 7266 :tags: zone 7267 :short: Contains information to answer queries when normal resolution would return NXDOMAIN. 7268 7269 Redirect zones are used to provide answers to queries when normal 7270 resolution would result in NXDOMAIN being returned. Only one redirect zone 7271 is supported per view. :any:`allow-query` can be used to restrict which 7272 clients see these answers. 7273 7274 If the client has requested DNSSEC records (DO=1) and the NXDOMAIN response 7275 is signed, no substitution occurs. 7276 7277 To redirect all NXDOMAIN responses to 100.100.100.2 and 7278 2001:ffff:ffff::100.100.100.2, configure a type :any:`redirect <type redirect>` zone 7279 named ".", with the zone file containing wildcard records that point to 7280 the desired addresses: ``*. IN A 100.100.100.2`` and 7281 ``*. IN AAAA 2001:ffff:ffff::100.100.100.2``. 7282 7283 As another example, to redirect all Spanish names (under .ES), use similar entries 7284 but with the names ``*.ES.`` instead of ``*.``. To redirect all commercial 7285 Spanish names (under COM.ES), use wildcard entries 7286 called ``*.COM.ES.``. 7287 7288 Note that the redirect zone supports all possible types; it is not 7289 limited to A and AAAA records. 7290 7291 If a redirect zone is configured with a :any:`primaries` option, then it is 7292 transferred in as if it were a secondary zone. Otherwise, it is loaded from a 7293 file as if it were a primary zone. 7294 7295 Because redirect zones are not referenced directly by name, they are not 7296 kept in the zone lookup table with normal primary and secondary zones. To reload 7297 a redirect zone, use :option:`rndc reload -redirect <rndc reload>`; to retransfer a 7298 redirect zone configured as a secondary, use :option:`rndc retransfer -redirect <rndc retransfer>`. 7299 When using :option:`rndc reload` without specifying a zone name, redirect 7300 zones are reloaded along with other zones. 7301 7302 .. namedconf:statement:: in-view 7303 :tags: view, zone 7304 :short: Specifies the view in which a given zone is defined. 7305 7306 When using multiple views, a :any:`type primary` or :any:`type secondary` zone configured 7307 in one view can be referenced in a subsequent view. This allows both views 7308 to use the same zone without the overhead of loading it more than once. This 7309 is configured using a :any:`zone` statement, with an :any:`in-view` option 7310 specifying the view in which the zone is defined. A :any:`zone` statement 7311 containing :any:`in-view` does not need to specify a type, since that is part 7312 of the zone definition in the other view. 7313 7314 See :ref:`multiple_views` for more information. 7315 7316 Class 7317 ^^^^^ 7318 7319 The zone's name may optionally be followed by a class. If a class is not 7320 specified, class ``IN`` (for ``Internet``) is assumed. This is correct 7321 for the vast majority of cases. 7322 7323 The ``hesiod`` class is named for an information service from MIT's 7324 Project Athena. It was used to share information about various systems 7325 databases, such as users, groups, printers, and so on. The keyword ``HS`` 7326 is a synonym for hesiod. 7327 7328 Another MIT development is Chaosnet, a LAN protocol created in the 7329 mid-1970s. Zone data for it can be specified with the ``CHAOS`` class. 7330 7331 .. _zone_options: 7332 7333 Zone Options 7334 ^^^^^^^^^^^^ 7335 7336 :any:`allow-notify` 7337 See the description of :any:`allow-notify` in :ref:`access_control`. 7338 7339 :any:`allow-query` 7340 See the description of :any:`allow-query` in :ref:`access_control`. 7341 7342 :any:`allow-query-on` 7343 See the description of :any:`allow-query-on` in :ref:`access_control`. 7344 7345 :any:`allow-transfer` 7346 See the description of :any:`allow-transfer` in :ref:`access_control`. 7347 7348 :any:`allow-update` 7349 See the description of :any:`allow-update` in :ref:`access_control`. 7350 7351 :any:`update-policy` 7352 This specifies a "Simple Secure Update" policy. See :ref:`dynamic_update_policies`. 7353 7354 :any:`allow-update-forwarding` 7355 See the description of :any:`allow-update-forwarding` in :ref:`access_control`. 7356 7357 :any:`also-notify` 7358 This option is only meaningful if :namedconf:ref:`notify` is active for this zone. The set of 7359 machines that receive a ``DNS NOTIFY`` message for this zone is 7360 made up of all the listed name servers (other than the primary) 7361 for the zone, plus any IP addresses specified with 7362 :any:`also-notify`. A port may be specified with each :any:`also-notify` 7363 address to send the notify messages to a port other than the default 7364 of 53. A TSIG key may also be specified to cause the ``NOTIFY`` to be 7365 signed by the given key. :any:`also-notify` is not meaningful for stub 7366 zones. The default is the empty list. 7367 7368 :any:`check-names` 7369 This option is used to restrict the character set and syntax of 7370 certain domain names in primary files and/or DNS responses received 7371 from the network. The default varies according to zone type. For 7372 :any:`primary <type primary>` zones the default is ``fail``; for :any:`secondary <type secondary>` zones the 7373 default is ``warn``. It is not implemented for :any:`hint <type hint>` zones. 7374 7375 :any:`check-mx` 7376 See the description of :any:`check-mx` in :ref:`boolean_options`. 7377 7378 :any:`check-spf` 7379 See the description of :any:`check-spf` in :ref:`boolean_options`. 7380 7381 :any:`check-wildcard` 7382 See the description of :any:`check-wildcard` in :ref:`boolean_options`. 7383 7384 :any:`check-integrity` 7385 See the description of :any:`check-integrity` in :ref:`boolean_options`. 7386 7387 :any:`check-sibling` 7388 See the description of :any:`check-sibling` in :ref:`boolean_options`. 7389 7390 :any:`zero-no-soa-ttl` 7391 See the description of :any:`zero-no-soa-ttl` in :ref:`boolean_options`. 7392 7393 :any:`update-check-ksk` 7394 See the description of :any:`update-check-ksk` in :ref:`boolean_options`. 7395 7396 :any:`dnssec-loadkeys-interval` 7397 See the description of :any:`dnssec-loadkeys-interval` in :namedconf:ref:`options`. 7398 7399 :any:`dnssec-update-mode` 7400 See the description of :any:`dnssec-update-mode` in :namedconf:ref:`options`. 7401 7402 :any:`dnssec-dnskey-kskonly` 7403 See the description of :any:`dnssec-dnskey-kskonly` in :ref:`boolean_options`. 7404 7405 :any:`try-tcp-refresh` 7406 See the description of :any:`try-tcp-refresh` in :ref:`boolean_options`. 7407 7408 .. namedconf:statement:: database 7409 :tags: zone 7410 :short: Specifies the type of database to be used to store zone data. 7411 7412 This specifies the type of database to be used to store the zone data. 7413 The string following the :any:`database` keyword is interpreted as a 7414 list of whitespace-delimited words. The first word identifies the 7415 database type, and any subsequent words are passed as arguments to 7416 the database to be interpreted in a way specific to the database 7417 type. 7418 7419 The default is ``rbt``, BIND 9's native in-memory red-black tree 7420 database. This database does not take arguments. 7421 7422 Other values are possible if additional database drivers have been 7423 linked into the server. Some sample drivers are included with the 7424 distribution but none are linked in by default. 7425 7426 :any:`dialup` 7427 See the description of :any:`dialup` in :ref:`boolean_options`. 7428 7429 .. namedconf:statement:: file 7430 :tags: zone 7431 :short: Specifies the zone's filename. 7432 7433 This sets the zone's filename. In :any:`primary <type primary>`, :any:`hint <type hint>`, and :any:`redirect <type redirect>` 7434 zones which do not have :any:`primaries` defined, zone data is loaded from 7435 this file. In :any:`secondary <type secondary>`, :any:`mirror <type mirror>`, :any:`stub <type stub>`, and :any:`redirect <type redirect>` zones 7436 which do have :any:`primaries` defined, zone data is retrieved from 7437 another server and saved in this file. This option is not applicable 7438 to other zone types. 7439 7440 :any:`forward` 7441 This option is only meaningful if the zone has a forwarders list. The ``only`` value 7442 causes the lookup to fail after trying the forwarders and getting no 7443 answer, while ``first`` allows a normal lookup to be tried. 7444 7445 :any:`forwarders` 7446 This is used to override the list of global forwarders. If it is not 7447 specified in a zone of type :any:`forward`, no forwarding is done for 7448 the zone and the global options are not used. 7449 7450 .. namedconf:statement:: journal 7451 :tags: zone 7452 :short: Allows the default journal's filename to be overridden. 7453 7454 This allows the default journal's filename to be overridden. The default is 7455 the zone's filename with "``.jnl``" appended. This is applicable to 7456 :any:`primary <type primary>` and :any:`secondary <type secondary>` zones. 7457 7458 :any:`max-ixfr-ratio` 7459 See the description of :any:`max-ixfr-ratio` in :namedconf:ref:`options`. 7460 7461 :any:`max-journal-size` 7462 See the description of :any:`max-journal-size` in :ref:`server_resource_limits`. 7463 7464 :any:`max-records` 7465 See the description of :any:`max-records` in :ref:`server_resource_limits`. 7466 7467 :any:`min-transfer-rate-in` 7468 See the description of :any:`min-transfer-rate-in` in :ref:`zone_transfers`. 7469 7470 :any:`max-transfer-time-in` 7471 See the description of :any:`max-transfer-time-in` in :ref:`zone_transfers`. 7472 7473 :any:`max-transfer-idle-in` 7474 See the description of :any:`max-transfer-idle-in` in :ref:`zone_transfers`. 7475 7476 :any:`max-transfer-time-out` 7477 See the description of :any:`max-transfer-time-out` in :ref:`zone_transfers`. 7478 7479 :any:`max-transfer-idle-out` 7480 See the description of :any:`max-transfer-idle-out` in :ref:`zone_transfers`. 7481 7482 :namedconf:ref:`notify` 7483 See the description of :namedconf:ref:`notify` in :ref:`boolean_options`. 7484 7485 :any:`notify-delay` 7486 See the description of :any:`notify-delay` in :ref:`tuning`. 7487 7488 :any:`notify-to-soa` 7489 See the description of :any:`notify-to-soa` in :ref:`boolean_options`. 7490 7491 :any:`parental-agents` 7492 This option is only meaningful if the zone is DNSSEC signed. When performing 7493 a key rollover, BIND will query the parental agents to see if the new DS is 7494 actually published before withdrawing the old DNSSEC key. 7495 7496 :any:`primaries` 7497 For secondary zones, these are the name servers to request zone transfers 7498 from. 7499 7500 :any:`zone-statistics` 7501 See the description of :any:`zone-statistics` in :namedconf:ref:`options`. 7502 7503 .. namedconf:statement:: server-addresses 7504 :tags: query, zone 7505 :short: Specifies a list of IP addresses to which queries should be sent in recursive resolution for a static-stub zone. 7506 7507 This option is only meaningful for :any:`static-stub <type static-stub>` zones. This is a list of IP addresses 7508 to which queries should be sent in recursive resolution for the zone. 7509 A non-empty list for this option internally configures the apex 7510 NS RR with associated glue A or AAAA RRs. 7511 7512 For example, if "example.com" is configured as a static-stub zone 7513 with 192.0.2.1 and 2001:db8::1234 in a :any:`server-addresses` option, 7514 the following RRs are internally configured: 7515 7516 :: 7517 7518 example.com. NS example.com. 7519 example.com. A 192.0.2.1 7520 example.com. AAAA 2001:db8::1234 7521 7522 These records are used internally to resolve names under the 7523 static-stub zone. For instance, if the server receives a query for 7524 "www.example.com" with the RD bit on, the server initiates 7525 recursive resolution and sends queries to 192.0.2.1 and/or 7526 2001:db8::1234. 7527 7528 .. namedconf:statement:: server-names 7529 :tags: zone 7530 :short: Specifies a list of domain names of name servers that act as authoritative servers of a static-stub zone. 7531 7532 This option is only meaningful for :any:`static-stub <type static-stub>` zones. This is a list of domain names 7533 of name servers that act as authoritative servers of the static-stub 7534 zone. These names are resolved to IP addresses when :iscman:`named` 7535 needs to send queries to these servers. For this supplemental 7536 resolution to be successful, these names must not be a subdomain of the 7537 origin name of the static-stub zone. That is, when "example.net" is the 7538 origin of a static-stub zone, "ns.example" and "master.example.com" 7539 can be specified in the :any:`server-names` option, but "ns.example.net" 7540 cannot; it is rejected by the configuration parser. 7541 7542 A non-empty list for this option internally configures the apex 7543 NS RR with the specified names. For example, if "example.com" is 7544 configured as a static-stub zone with "ns1.example.net" and 7545 "ns2.example.net" in a :any:`server-names` option, the following RRs 7546 are internally configured: 7547 7548 :: 7549 7550 example.com. NS ns1.example.net. 7551 example.com. NS ns2.example.net. 7552 7553 These records are used internally to resolve names under the 7554 static-stub zone. For instance, if the server receives a query for 7555 "www.example.com" with the RD bit on, the server initiates recursive 7556 resolution, resolves "ns1.example.net" and/or "ns2.example.net" to IP 7557 addresses, and then sends queries to one or more of these addresses. 7558 7559 :any:`sig-validity-interval` 7560 See the description of :any:`sig-validity-interval` in :ref:`tuning`. 7561 7562 :any:`sig-signing-nodes` 7563 See the description of :any:`sig-signing-nodes` in :ref:`tuning`. 7564 7565 :any:`sig-signing-signatures` 7566 See the description of :any:`sig-signing-signatures` in 7567 :ref:`tuning`. 7568 7569 :any:`sig-signing-type` 7570 See the description of :any:`sig-signing-type` in :ref:`tuning`. 7571 7572 :any:`transfer-source` 7573 See the description of :any:`transfer-source` in :ref:`zone_transfers`. 7574 7575 :any:`transfer-source-v6` 7576 See the description of :any:`transfer-source-v6` in :ref:`zone_transfers`. 7577 7578 :any:`notify-source` 7579 See the description of :any:`notify-source` in :ref:`zone_transfers`. 7580 7581 :any:`notify-source-v6` 7582 See the description of :any:`notify-source-v6` in :ref:`zone_transfers`. 7583 7584 :any:`min-refresh-time`; :any:`max-refresh-time`; :any:`min-retry-time`; :any:`max-retry-time` 7585 See the descriptions in :ref:`tuning`. 7586 7587 :any:`ixfr-from-differences` 7588 See the description of :any:`ixfr-from-differences` in :ref:`boolean_options`. 7589 (Note that the :any:`ixfr-from-differences` choices of :any:`primary <type primary>` and :any:`secondary <type secondary>` 7590 are not available at the zone level.) 7591 7592 :any:`key-directory` 7593 See the description of :any:`key-directory` in :namedconf:ref:`options`. 7594 7595 :any:`serial-update-method` 7596 See the description of :any:`serial-update-method` in :namedconf:ref:`options`. 7597 7598 .. namedconf:statement:: inline-signing 7599 :tags: dnssec, zone 7600 :short: Specifies whether BIND 9 maintains a separate signed version of a zone. 7601 7602 The use of inline signing is determined by the :any:`dnssec-policy` for 7603 the zone. If :any:`inline-signing` is explicitly set to ``yes`` or ``no`` 7604 in :any:`zone`, it overrides any value from :any:`dnssec-policy`. 7605 7606 :any:`multi-master` 7607 See the description of :any:`multi-master` in :ref:`boolean_options`. 7608 7609 :any:`masterfile-format` 7610 See the description of :any:`masterfile-format` in :ref:`tuning`. 7611 7612 :any:`max-zone-ttl` 7613 See the description of :any:`max-zone-ttl` in :namedconf:ref:`options`. 7614 The use of this option in :any:`zone` blocks is deprecated and 7615 will be rendered non-operational in a future release. 7616 7617 .. _dynamic_update_policies: 7618 7619 Dynamic Update Policies 7620 ^^^^^^^^^^^^^^^^^^^^^^^ 7621 7622 BIND 9 supports two methods of granting clients the right to 7623 perform dynamic updates to a zone: 7624 7625 - :namedconf:ref:`allow-update` - a simple access control list 7626 - :namedconf:ref:`update-policy` - fine-grained access control 7627 7628 In both cases, BIND 9 writes the updates to the zone's filename 7629 set in :any:`file`. 7630 7631 In the case of a DNSSEC zone where :any:`inline-signing` is disabled, DNSSEC 7632 records are also written to the zone's filename. 7633 7634 .. note:: The zone file can no longer be manually updated while :iscman:`named` 7635 is running; it is now necessary to perform :option:`rndc freeze`, edit, 7636 and then perform :option:`rndc thaw`. Comments and formatting 7637 in the zone file are lost when dynamic updates occur. 7638 7639 .. namedconf:statement:: update-policy 7640 :tags: transfer 7641 :short: Sets fine-grained rules to allow or deny dynamic updates (DDNS), based on requester identity, updated content, etc. 7642 7643 The :any:`update-policy` clause allows more fine-grained control over which 7644 updates are allowed. It specifies a set of rules, in which each rule 7645 either grants or denies permission for one or more names in the zone to 7646 be updated by one or more identities. Identity is determined by the key 7647 that signed the update request, using either TSIG or SIG(0). In most 7648 cases, :any:`update-policy` rules only apply to key-based identities. There 7649 is no way to specify update permissions based on the client source address. 7650 7651 :any:`update-policy` rules are only meaningful for zones of 7652 :any:`type primary`, and are not allowed in any other zone type. It is a 7653 configuration error to specify both :any:`allow-update` and 7654 :any:`update-policy` at the same time. 7655 7656 A pre-defined :any:`update-policy` rule can be switched on with the command 7657 ``update-policy local;``. :iscman:`named` automatically 7658 generates a TSIG session key when starting and stores it in a file; 7659 this key can then be used by local clients to update the zone while 7660 :iscman:`named` is running. By default, the session key is stored in the file 7661 |session_key|, the key name is "local-ddns", and the 7662 key algorithm is HMAC-SHA256. These values are configurable with the 7663 :any:`session-keyfile`, :any:`session-keyname`, and :any:`session-keyalg` options, 7664 respectively. A client running on the local system, if run with 7665 appropriate permissions, may read the session key from the key file and 7666 use it to sign update requests. The zone's update policy is set to 7667 allow that key to change any record within the zone. Assuming the key 7668 name is "local-ddns", this policy is equivalent to: 7669 7670 :: 7671 7672 update-policy { grant local-ddns zonesub any; }; 7673 7674 with the additional restriction that only clients connecting from the 7675 local system are permitted to send updates. 7676 7677 Note that only one session key is generated by :iscman:`named`; all zones 7678 configured to use ``update-policy local`` accept the same key. 7679 7680 The command ``nsupdate -l`` implements this feature, sending requests to 7681 localhost and signing them using the key retrieved from the session key 7682 file. 7683 7684 Other rule definitions look like this: 7685 7686 :: 7687 7688 ( grant | deny ) identity ruletype name types 7689 7690 Each rule grants or denies privileges. Rules are checked in the order in 7691 which they are specified in the :any:`update-policy` statement. Once a 7692 message has successfully matched a rule, the operation is immediately 7693 granted or denied, and no further rules are examined. There are 16 types 7694 of rules; the rule type is specified by the ``ruletype`` field, and the 7695 interpretation of other fields varies depending on the rule type. 7696 7697 In general, a rule is matched when the key that signed an update request 7698 matches the ``identity`` field, the name of the record to be updated 7699 matches the ``name`` field (in the manner specified by the ``ruletype`` 7700 field), and the type of the record to be updated matches the ``types`` 7701 field. Details for each rule type are described below. 7702 7703 The ``identity`` field must be set to a fully qualified domain name. In 7704 most cases, this represents the name of the TSIG or SIG(0) key that 7705 must be used to sign the update request. If the specified name is a 7706 wildcard, it is subject to DNS wildcard expansion, and the rule may 7707 apply to multiple identities. When a TKEY exchange has been used to 7708 create a shared secret, the identity of the key used to authenticate the 7709 TKEY exchange is used as the identity of the shared secret. Some 7710 rule types use identities matching the client's Kerberos principal (e.g, 7711 ``"host/machine@REALM"``) or Windows realm (``machine$@REALM``). 7712 7713 The ``name`` field also specifies a fully qualified domain name. This often 7714 represents the name of the record to be updated. Interpretation of this 7715 field is dependent on rule type. 7716 7717 If no ``types`` are explicitly specified, then a rule matches all types 7718 except RRSIG, NS, SOA, NSEC, and NSEC3. Types may be specified by name, 7719 including ``ANY``; ANY matches all types except NSEC and NSEC3, which can 7720 never be updated. Note that when an attempt is made to delete all 7721 records associated with a name, the rules are checked for each existing 7722 record type. 7723 7724 If the type is immediately followed by a number in parentheses, 7725 that number is the maximum number of records of that type permitted 7726 to exist in the RRset after an update has been applied. For example, 7727 ``PTR(1)`` indicates that only one PTR record is allowed. If an 7728 attempt is made to add two PTR records in an update, the second one 7729 is silently discarded. If a PTR record already exists, both 7730 new records are silently discarded. 7731 7732 If type ANY is specified with a limit, then that limit applies to 7733 all types that are not otherwise specified. For example, ``A PTR(1) 7734 ANY(2)`` indicates that an unlimited number of A records can exist, 7735 but only one PTR record, and no more than two of any other type. 7736 7737 Typical use with a rule ``grant * tcp-self . PTR(1);`` in the zone 7738 2.0.192.IN-ADDR.ARPA looks like this: 7739 7740 :: 7741 7742 nsupdate -v <<EOF 7743 local 192.0.2.1 7744 del 1.2.0.192.IN-ADDR.ARPA PTR 7745 add 1.2.0.192.IN-ADDR.ARPA 0 PTR EXAMPLE.COM 7746 send 7747 EOF 7748 7749 The ruletype field has 18 values: ``name``, ``subdomain``, ``zonesub``, 7750 ``wildcard``, ``self``, ``selfsub``, ``selfwild``, ``ms-self``, 7751 ``ms-selfsub``, ``ms-subdomain``, ``ms-subdomain-self-rhs``, ``krb5-self``, 7752 ``krb5-selfsub``, ``krb5-subdomain``, ``krb5-subdomain-self-rhs``, 7753 ``tcp-self``, ``6to4-self``, and ``external``. 7754 7755 ``name`` 7756 With exact-match semantics, this rule matches when the name being updated is identical to the contents of the ``name`` field. 7757 7758 ``subdomain`` 7759 This rule matches when the name being updated is a subdomain of, or identical to, the contents of the ``name`` field. 7760 7761 ``zonesub`` 7762 This rule is similar to subdomain, except that it matches when the name being updated is a subdomain of the zone in which the :any:`update-policy` statement appears. This obviates the need to type the zone name twice, and enables the use of a standard :any:`update-policy` statement in multiple zones without modification. 7763 When this rule is used, the ``name`` field is omitted. 7764 7765 ``wildcard`` 7766 The ``name`` field is subject to DNS wildcard expansion, and this rule matches when the name being updated is a valid expansion of the wildcard. 7767 7768 ``self`` 7769 This rule matches when the name of the record being updated matches the contents of the ``identity`` field. The ``name`` field is ignored. To avoid confusion, it is recommended that this field be set to the same value as the ``identity`` field or to "." 7770 The ``self`` rule type is most useful when allowing one key per name to update, where the key has the same name as the record to be updated. In this case, the ``identity`` field can be specified as ``*`` (asterisk). 7771 7772 ``selfsub`` 7773 This rule is similar to ``self``, except that subdomains of ``self`` can also be updated. 7774 7775 ``selfwild`` 7776 This rule is similar to ``self``, except that only subdomains of ``self`` can be updated. 7777 7778 ``ms-self`` 7779 When a client sends an UPDATE using a Windows machine principal (for example, ``machine$@REALM``), this rule allows records with the absolute name of ``machine.REALM`` to be updated. 7780 7781 The realm to be matched is specified in the ``identity`` field. 7782 7783 The ``name`` field has no effect on this rule; it should be set to "." as a placeholder. 7784 7785 For example, ``grant EXAMPLE.COM ms-self . A AAAA`` allows any machine with a valid principal in the realm ``EXAMPLE.COM`` to update its own address records. 7786 7787 ``ms-selfsub`` 7788 This is similar to ``ms-self``, except it also allows updates to any subdomain of the name specified in the Windows machine principal, not just to the name itself. 7789 7790 ``ms-subdomain`` 7791 When a client sends an UPDATE using a Windows machine principal (for example, ``machine$@REALM``), this rule allows any machine in the specified realm to update any record in the zone or in a specified subdomain of the zone. 7792 7793 The realm to be matched is specified in the ``identity`` field. 7794 7795 The ``name`` field specifies the subdomain that may be updated. If set to "." or any other name at or above the zone apex, any name in the zone can be updated. 7796 7797 For example, if :any:`update-policy` for the zone "example.com" includes ``grant EXAMPLE.COM ms-subdomain hosts.example.com. AA AAAA``, any machine with a valid principal in the realm ``EXAMPLE.COM`` is able to update address records at or below ``hosts.example.com``. 7798 7799 ``ms-subdomain-self-rhs`` 7800 This rule is similar to ``ms-subdomain``, with an additional 7801 restriction that PTR and SRV target names must match the name of the 7802 machine identified in the principal. 7803 7804 ``krb5-self`` 7805 When a client sends an UPDATE using a Kerberos machine principal (for example, ``host/machine@REALM``), this rule allows records with the absolute name of ``machine`` to be updated, provided it has been authenticated by REALM. This is similar but not identical to ``ms-self``, due to the ``machine`` part of the Kerberos principal being an absolute name instead of an unqualified name. 7806 7807 The realm to be matched is specified in the ``identity`` field. 7808 7809 The ``name`` field has no effect on this rule; it should be set to "." as a placeholder. 7810 7811 For example, ``grant EXAMPLE.COM krb5-self . A AAAA`` allows any machine with a valid principal in the realm ``EXAMPLE.COM`` to update its own address records. 7812 7813 ``krb5-selfsub`` 7814 This is similar to ``krb5-self``, except it also allows updates to any subdomain of the name specified in the ``machine`` part of the Kerberos principal, not just to the name itself. 7815 7816 ``krb5-subdomain`` 7817 This rule is identical to ``ms-subdomain``, except that it works with Kerberos machine principals (i.e., ``host/machine@REALM``) rather than Windows machine principals. 7818 7819 ``krb5-subdomain-self-rhs`` 7820 This rule is similar to ``krb5-subdomain``, with an additional 7821 restriction that PTR and SRV target names must match the name of the 7822 machine identified in the principal. 7823 7824 ``tcp-self`` 7825 This rule allows updates that have been sent via TCP and for which the standard mapping from the client's IP address into the ``in-addr.arpa`` and ``ip6.arpa`` namespaces matches the name to be updated. The ``identity`` field must match that name. The ``name`` field should be set to ".". Note that, since identity is based on the client's IP address, it is not necessary for update request messages to be signed. 7826 7827 .. note:: 7828 It is theoretically possible to spoof these TCP sessions. 7829 7830 ``6to4-self`` 7831 This allows the name matching a 6to4 IPv6 prefix, as specified in :rfc:`3056`, to be updated by any TCP connection from either the 6to4 network or from the corresponding IPv4 address. This is intended to allow NS or DNAME RRsets to be added to the ``ip6.arpa`` reverse tree. 7832 7833 The ``identity`` field must match the 6to4 prefix in ``ip6.arpa``. The ``name`` field should be set to ".". Note that, since identity is based on the client's IP address, it is not necessary for update request messages to be signed. 7834 7835 In addition, if specified for an ``ip6.arpa`` name outside of the ``2.0.0.2.ip6.arpa`` namespace, the corresponding /48 reverse name can be updated. For example, TCP/IPv6 connections from 2001:DB8:ED0C::/48 can update records at ``C.0.D.E.8.B.D.0.1.0.0.2.ip6.arpa``. 7836 7837 .. note:: 7838 It is theoretically possible to spoof these TCP sessions. 7839 7840 ``external`` 7841 This rule allows :iscman:`named` to defer the decision of whether to allow a given update to an external daemon. 7842 7843 The method of communicating with the daemon is specified in the ``identity`` field, the format of which is "``local:``\ path", where "path" is the location of a Unix-domain socket. (Currently, "local" is the only supported mechanism.) 7844 7845 Requests to the external daemon are sent over the Unix-domain socket as datagrams with the following format: 7846 7847 :: 7848 7849 Protocol version number (4 bytes, network byte order, currently 1) 7850 Request length (4 bytes, network byte order) 7851 Signer (null-terminated string) 7852 Name (null-terminated string) 7853 TCP source address (null-terminated string) 7854 Rdata type (null-terminated string) 7855 Key (null-terminated string) 7856 TKEY token length (4 bytes, network byte order) 7857 TKEY token (remainder of packet) 7858 7859 The daemon replies with a four-byte value in network byte order, containing either 0 or 1; 0 indicates that the specified update is not permitted, and 1 indicates that it is. 7860 7861 .. warning:: The external daemon must not delay communication. This policy is evaluated synchronously; any wait period negatively affects :iscman:`named` performance. 7862 7863 .. _multiple_views: 7864 7865 Multiple Views 7866 ^^^^^^^^^^^^^^ 7867 7868 When multiple views are in use, a zone may be referenced by more than 7869 one of them. Often, the views contain different zones with the same 7870 name, allowing different clients to receive different answers for the 7871 same queries. At times, however, it is desirable for multiple views to 7872 contain identical zones. The :any:`in-view` zone option provides an 7873 efficient way to do this; it allows a view to reference a zone that was 7874 defined in a previously configured view. For example: 7875 7876 :: 7877 7878 view internal { 7879 match-clients { 10/8; }; 7880 7881 zone example.com { 7882 type primary; 7883 file "example-external.db"; 7884 }; 7885 }; 7886 7887 view external { 7888 match-clients { any; }; 7889 7890 zone example.com { 7891 in-view internal; 7892 }; 7893 }; 7894 7895 An :any:`in-view` option cannot refer to a view that is configured later in 7896 the configuration file. 7897 7898 A :any:`zone` statement which uses the :any:`in-view` option may not use any 7899 other options, with the exception of :any:`forward` and :any:`forwarders`. 7900 (These options control the behavior of the containing view, rather than 7901 change the zone object itself.) 7902 7903 Zone-level ACLs (e.g., allow-query, allow-transfer), and other 7904 configuration details of the zone, are all set in the view the referenced 7905 zone is defined in. Be careful to ensure that ACLs are wide 7906 enough for all views referencing the zone. 7907 7908 An :any:`in-view` zone cannot be used as a response policy zone. 7909 7910 An :any:`in-view` zone is not intended to reference a :any:`forward` zone. 7911 7912 Statements 7913 ---------- 7914 BIND 9 supports many hundreds of statements; finding the right statement to 7915 control a specific behavior or solve a particular problem can be a daunting 7916 task. To simplify the task for users, all statements have been assigned one or more tags. 7917 Tags are designed to group together statements that have broadly similar 7918 functionality; thus, for example, all statements that control the handling of 7919 queries or of zone transfers are respectively tagged under **query** and **transfer**. 7920 7921 :ref:`dnssec_tag_statements` are those that relate to or control DNSSEC. 7922 7923 :ref:`logging_tag_statements` relate to or control logging, and typically only 7924 appear in a logging block. 7925 7926 :ref:`query_tag_statements` relate to or control queries. 7927 7928 :ref:`security_tag_statements` relate to or control security features. 7929 7930 :ref:`server_tag_statements` relate to or control server behavior, and typically 7931 only appear in a server block. 7932 7933 :ref:`transfer_tag_statements` relate to or control zone transfers. 7934 7935 :ref:`view_tag_statements` relate to or control view selection criteria, and 7936 typically only appear in a view block. 7937 7938 :ref:`zone_tag_statements` relate to or control zone behavior, and typically 7939 only appear in a zone block. 7940 7941 :ref:`deprecated_tag_statements` are those that are now deprecated, but are 7942 included here for historical reference. 7943 7944 The following table lists all statements permissible in :file:`named.conf`, with their 7945 associated tags; the next section groups the statements by tag. Please note that these 7946 sections are a work in progress. 7947 7948 .. namedconf:statementlist:: 7949 7950 Statements by Tag 7951 ----------------- 7952 These tables group the various statements permissible in :file:`named.conf` by 7953 their corresponding tag. 7954 7955 .. _dnssec_tag_statements: 7956 7957 DNSSEC Tag Statements 7958 ~~~~~~~~~~~~~~~~~~~~~ 7959 .. namedconf:statementlist:: 7960 :filter_tags: dnssec 7961 7962 .. _logging_tag_statements: 7963 7964 Logging Tag Statements 7965 ~~~~~~~~~~~~~~~~~~~~~~ 7966 .. namedconf:statementlist:: 7967 :filter_tags: logging 7968 7969 .. _query_tag_statements: 7970 7971 Query Tag Statements 7972 ~~~~~~~~~~~~~~~~~~~~ 7973 .. namedconf:statementlist:: 7974 :filter_tags: query 7975 7976 .. _security_tag_statements: 7977 7978 Security Tag Statements 7979 ~~~~~~~~~~~~~~~~~~~~~~~ 7980 .. namedconf:statementlist:: 7981 :filter_tags: security 7982 7983 .. _server_tag_statements: 7984 7985 Server Tag Statements 7986 ~~~~~~~~~~~~~~~~~~~~~ 7987 .. namedconf:statementlist:: 7988 :filter_tags: server 7989 7990 .. _transfer_tag_statements: 7991 7992 Transfer Tag Statements 7993 ~~~~~~~~~~~~~~~~~~~~~~~ 7994 .. namedconf:statementlist:: 7995 :filter_tags: transfer 7996 7997 .. _view_tag_statements: 7998 7999 View Tag Statements 8000 ~~~~~~~~~~~~~~~~~~~ 8001 .. namedconf:statementlist:: 8002 :filter_tags: view 8003 8004 .. _zone_tag_statements: 8005 8006 Zone Tag Statements 8007 ~~~~~~~~~~~~~~~~~~~ 8008 .. namedconf:statementlist:: 8009 :filter_tags: zone 8010 8011 .. _deprecated_tag_statements: 8012 8013 Deprecated Tag Statements 8014 ~~~~~~~~~~~~~~~~~~~~~~~~~ 8015 .. namedconf:statementlist:: 8016 :filter_tags: deprecated 8017 8018 .. _statistics: 8019 8020 BIND 9 Statistics 8021 ----------------- 8022 8023 BIND 9 maintains lots of statistics information and provides several 8024 interfaces for users to access those statistics. The available 8025 statistics include all statistics counters that are meaningful in BIND 9, 8026 and other information that is considered useful. 8027 8028 The statistics information is categorized into the following sections: 8029 8030 Incoming Requests 8031 The number of incoming DNS requests for each OPCODE. 8032 8033 Incoming Queries 8034 The number of incoming queries for each RR type. 8035 8036 Outgoing Queries 8037 The number of outgoing queries for each RR type sent from the internal 8038 resolver, maintained per view. 8039 8040 Incoming Zone Transfers 8041 Information about in-progress incoming zone transfers. 8042 8043 This section describes the information that can be seen in the 8044 HTML table about in-progress incoming zone transfers. It lists 8045 the meaning, units, and possible range of values of each column, 8046 and the key/attribute/element name (in parentheses) for the JSON 8047 and XML output formats. 8048 8049 ``Zone Name`` (``name``) 8050 Text string. This is the name of the zone being transferred, 8051 as specified in the :any:`zone` declaration on this server. 8052 8053 ``Zone Type`` (``type``) 8054 Text string. This is the type of zone being transferred, as 8055 specified in the ``zone`` declaration on this server. Possible 8056 values are: ``secondary``, ``stub``, ``redirect``, and ``mirror``. 8057 8058 ``Local Serial`` (``serial``) 8059 32-bit unsigned Integer. This is the current (old) serial 8060 number of the zone being transferred. It comes from the SOA 8061 record held on the current server. 8062 8063 ``Remote Serial`` (``remoteserial``) 8064 32-bit unsigned Integer. This is the new serial number of the 8065 zone being transferred. It comes from the SOA record held on 8066 the primary server from which the zone is being transferred. 8067 8068 ``IXFR`` (``ixfr``) 8069 Boolean. This says whether the transfer is incremental (using 8070 IXFR) or full (using AXFR). Possible values are: ``Yes`` and 8071 ``No``. 8072 8073 ``State`` (``state``) 8074 Text string. This is the current state of the transfer for 8075 this zone. Possible values and their meanings are: 8076 8077 ``Needs Refresh`` 8078 The zone needs a refresh, but the process has not started yet; 8079 this can be due to different factors, like the retry interval of 8080 the zone. 8081 8082 ``Pending`` 8083 The zone is flagged for a refresh, but the process is currently 8084 in the queue and will start shortly, or is in a waiting state 8085 because of rate-limiting; see :any:`serial-query-rate`. The 8086 ``Duration (s)`` timer starts before entering this state. 8087 8088 ``Refresh SOA`` 8089 BIND is sending a refresh SOA query to get the zone serial number and will then 8090 initiate a zone transfer, if necessary. If this step is successful, 8091 the ``SOA Query`` and ``Got SOA`` states are skipped. 8092 Otherwise, the zone transfer procedure can still be initiated, 8093 and the SOA request will be attempted using the same transport as 8094 the zone transfer. The ``Duration (s)`` timer restarts before 8095 entering this state, and for each attempted connection (note that 8096 in UDP mode there can be several retries during one "connection" 8097 attempt). 8098 8099 ``Deferred`` 8100 The zone is going to be refreshed, but the process was 8101 deferred due to quota; see :any:`transfers-in` and 8102 :any:`transfers-per-ns`. The ``Duration (s)`` timer restarts before 8103 entering this state. 8104 8105 ``SOA Query`` 8106 BIND is sending an SOA query to get the zone serial number and will then 8107 follow with a zone transfer, if necessary. The ``Duration (s)`` 8108 timer restarts before entering this state. 8109 8110 ``Got SOA`` 8111 An answer for the SOA query from the previous step is 8112 received, initiating a transfer. 8113 8114 ``Zone Transfer Request`` 8115 BIND is waiting for the zone transfer to start. The ``Duration (s)`` timer 8116 restarts before entering this state. 8117 8118 ``First Data`` 8119 BIND is waiting for the first data record of the transfer. 8120 8121 ``Receiving IXFR Data`` 8122 BIND is receiving data for an IXFR type incremental zone 8123 transfer. 8124 8125 ``Finalizing IXFR`` 8126 BIND is finalizing an IXFR type incremental zone transfer. 8127 8128 ``Receiving AXFR Data`` 8129 BIND is receiving data for an AXFR type zone transfer. 8130 8131 ``Finalizing AXFR`` 8132 BIND is finalizing an AXFR type zone transfer. 8133 8134 .. note:: 8135 State names can change between BIND versions. 8136 8137 ``Additional Refresh Queued`` (``refreshqueued``) 8138 Boolean. This shows that the zone is flagged for a refresh. 8139 This can be set to ``Yes`` either when the zone transfer is 8140 still in one of the pending states (see the description of 8141 the ``State`` column), or when the transfer is in a running 8142 state, but the zone was marked for another refresh again (e.g. 8143 because of "notify" request from a primary server). Possible 8144 values are: ``Yes`` and ``No``. 8145 8146 ``Local Address`` (``localaddr``) 8147 IP address (IPv4 or IPv6, as appropriate) and port number. 8148 This shows the source address used to establish the connection 8149 for the transfer. 8150 8151 ``Remote Address`` (``remoteaddr``) 8152 IP address (IPv4 or IPv6, as appropriate) and port number. 8153 This shows the destination address used to establish the 8154 connection for the transfer. 8155 8156 ``SOA Transport`` (``soatransport``) 8157 Text string. This is the transport protocol in use for the 8158 SOA query. Note that this value can potentially change during the 8159 process. For example, when the transfer is in the ``Refresh SOA`` 8160 state, the ``SOA Transport`` of the ongoing query can be shown as ``UDP``. 8161 If that query fails or times out, it then can be retried using another 8162 transport, or the transfer process can be initiated in "SOA before" mode, 8163 where the SOA query will be attempted using the same transport as the zone 8164 transfer. See the description of the ``State`` field for more information. 8165 Possible values are: ``UDP``, ``TCP``, ``TLS``, and ``None``. 8166 8167 ``Transport`` (``transport``) 8168 Text string. This is the transport protocol in use for the 8169 transfer. Possible values are: ``TCP`` and ``TLS``. 8170 8171 ``TSIG Key Name`` (``tsigkeyname``) 8172 Text string. This is the name of the TSIG key specified for 8173 use with this zone in the :any:`zone` declaration (if any). 8174 8175 ``Duration (s)`` (``duration``) 8176 64-bit unsigned Integer. This is the time, in seconds, that 8177 the current major state of the transfer process has been running so far. 8178 The timer starts after the refresh SOA request is queued (before the 8179 ``Pending`` state), and then restarts several times during the 8180 process to indicate the duration of the current major state. See the 8181 descriptions of the different states to find out the states before which 8182 this timer restarts. 8183 8184 ``Messages Received`` (``nmsg``) 8185 64-bit unsigned Integer. This is the number of DNS messages 8186 received. It does not include transport overheads, such as 8187 TCP ACK. 8188 8189 ``Records Received`` (``nrecs``) 8190 64-bit unsigned Integer. This is the number of individual RRs 8191 received so far. If an address record has, for example, five 8192 addresses associated with the same name, it counts as five 8193 RRs. 8194 8195 ``Bytes Received`` (``nbytes``) 8196 64-bit unsigned Integer. This is the number of usable bytes 8197 of DNS data. It does not include transport overhead. 8198 8199 ``Transfer Rate (B/s)`` (``rate``) 8200 64 bit unsigned Integer. This is the average zone transfer rate in 8201 bytes-per-second during the latest full interval that is configured by the 8202 :any:`min-transfer-rate-in` configuration option. If no such interval 8203 has passed yet, then the overall average rate is reported instead. 8204 8205 .. note:: 8206 Depending on the current state of the transfer, some of the 8207 values may be empty or set to ``-`` (meaning "not available"). 8208 Also, in the case of the JSON output format, the corresponding 8209 keys can be missing or values can be set to ``NULL``. For 8210 example, it is unknown whether a transfer is using AXFR or 8211 IXFR until the first data is received (see the description 8212 of the ``State`` column). 8213 8214 Name Server Statistics 8215 Statistics counters for incoming request processing. 8216 8217 Zone Maintenance Statistics 8218 Statistics counters regarding zone maintenance operations, such as zone 8219 transfers. 8220 8221 Resolver Statistics 8222 Statistics counters for name resolutions performed in the internal resolver, 8223 maintained per view. 8224 8225 Cache DB RRsets 8226 Statistics counters related to cache contents, maintained per view. 8227 8228 The "NXDOMAIN" counter is the number of names that have been cached as 8229 nonexistent. Counters named for RR types indicate the number of active 8230 RRsets for each type in the cache database. 8231 8232 If an RR type name is preceded by an exclamation point (!), it represents the 8233 number of records in the cache which indicate that the type does not exist 8234 for a particular name; this is also known as "NXRRSET". If an RR type name 8235 is preceded by a hash mark (#), it represents the number of RRsets for this 8236 type that are present in the cache but whose TTLs have expired; these RRsets 8237 may only be used if stale answers are enabled. If an RR type name is 8238 preceded by a tilde (~), it represents the number of RRsets for this type 8239 that are present in the cache database but are marked for garbage collection; 8240 these RRsets cannot be used. 8241 8242 Socket I/O Statistics 8243 Statistics counters for network-related events. 8244 8245 A subset of Name Server Statistics is collected and shown per zone for 8246 which the server has the authority, when :any:`zone-statistics` is set to 8247 ``full`` (or ``yes``), for backward compatibility. See the description of 8248 :any:`zone-statistics` in :namedconf:ref:`options` for further details. 8249 8250 These statistics counters are shown with their zone and view names. The 8251 view name is omitted when the server is not configured with explicit 8252 views. 8253 8254 There are currently two user interfaces to get access to the statistics. 8255 One is in plain-text format, dumped to the file specified by the 8256 :any:`statistics-file` configuration option; the other is remotely 8257 accessible via a statistics channel when the :any:`statistics-channels` 8258 statement is specified in the configuration file. 8259 8260 .. _statsfile: 8261 8262 The Statistics File 8263 ~~~~~~~~~~~~~~~~~~~ 8264 8265 The text format statistics dump begins with a line, like: 8266 8267 ``+++ Statistics Dump +++ (973798949)`` 8268 8269 The number in parentheses is a standard Unix-style timestamp, measured 8270 in seconds since January 1, 1970. Following that line is a set of 8271 statistics information, which is categorized as described above. Each 8272 section begins with a line, like: 8273 8274 ``++ Name Server Statistics ++`` 8275 8276 Each section consists of lines, each containing the statistics counter 8277 value followed by its textual description; see below for available 8278 counters. For brevity, counters that have a value of 0 are not shown in 8279 the statistics file. 8280 8281 The statistics dump ends with the line where the number is identical to 8282 the number in the beginning line; for example: 8283 8284 ``--- Statistics Dump --- (973798949)`` 8285 8286 .. _statistics_counters: 8287 8288 Statistics Counters 8289 ~~~~~~~~~~~~~~~~~~~ 8290 8291 The following lists summarize the statistics counters that BIND 9 provides. 8292 For each counter, the abbreviated 8293 symbol name is given; these symbols are shown in the statistics 8294 information accessed via an HTTP statistics channel. 8295 The description of the counter is also shown in the 8296 statistics file but, in this document, may be slightly 8297 modified for better readability. 8298 8299 .. _stats_counters: 8300 8301 Name Server Statistics Counters 8302 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8303 8304 ``Requestv4`` 8305 This indicates the number of IPv4 requests received. Note: this also counts non-query requests. 8306 8307 ``Requestv6`` 8308 This indicates the number of IPv6 requests received. Note: this also counts non-query requests. 8309 8310 ``ReqEdns0`` 8311 This indicates the number of requests received with EDNS(0). 8312 8313 ``ReqBadEDN SVer`` 8314 This indicates the number of requests received with an unsupported EDNS version. 8315 8316 ``ReqTSIG`` 8317 This indicates the number of requests received with TSIG. 8318 8319 ``ReqSIG0`` 8320 This indicates the number of requests received with SIG(0). 8321 8322 ``ReqBadSIG`` 8323 This indicates the number of requests received with an invalid (TSIG or SIG(0)) signature. 8324 8325 ``ReqTCP`` 8326 This indicates the number of TCP requests received. 8327 8328 ``AuthQryRej`` 8329 This indicates the number of rejected authoritative (non-recursive) queries. 8330 8331 ``RecQryRej`` 8332 This indicates the number of rejected recursive queries. 8333 8334 ``XfrRej`` 8335 This indicates the number of rejected zone transfer requests. 8336 8337 ``UpdateRej`` 8338 This indicates the number of rejected dynamic update requests. 8339 8340 ``Response`` 8341 This indicates the number of responses sent. 8342 8343 ``RespTruncated`` 8344 This indicates the number of truncated responses sent. 8345 8346 ``RespEDNS0`` 8347 This indicates the number of responses sent with EDNS(0). 8348 8349 ``RespTSIG`` 8350 This indicates the number of responses sent with TSIG. 8351 8352 ``RespSIG0`` 8353 This indicates the number of responses sent with SIG(0). 8354 8355 ``QrySuccess`` 8356 This indicates the number of queries that resulted in a successful answer, meaning queries which return a NOERROR response with at least one answer RR. This corresponds to the ``success`` counter of previous versions of BIND 9. 8357 8358 ``QryAuthAns`` 8359 This indicates the number of queries that resulted in an authoritative answer. 8360 8361 ``QryNoauthAns`` 8362 This indicates the number of queries that resulted in a non-authoritative answer. 8363 8364 ``QryReferral`` 8365 This indicates the number of queries that resulted in a referral answer. This corresponds to the ``referral`` counter of previous versions of BIND 9. 8366 8367 ``QryNxrrset`` 8368 This indicates the number of queries that resulted in NOERROR responses with no data. This corresponds to the ``nxrrset`` counter of previous versions of BIND 9. 8369 8370 ``QrySERVFAIL`` 8371 This indicates the number of queries that resulted in SERVFAIL. 8372 8373 ``QryFORMERR`` 8374 This indicates the number of queries that resulted in FORMERR. 8375 8376 ``QryNXDOMAIN`` 8377 This indicates the number of queries that resulted in NXDOMAIN. This corresponds to the ``nxdomain`` counter of previous versions of BIND 9. 8378 8379 ``QryRecursion`` 8380 This indicates the number of queries that caused the server to perform recursion in order to find the final answer. This corresponds to the :any:`recursion` counter of previous versions of BIND 9. 8381 8382 ``QryDuplicate`` 8383 This indicates the number of queries which the server attempted to recurse but for which it discovered an existing query with the same IP address, port, query ID, name, type, and class already being processed. This corresponds to the ``duplicate`` counter of previous versions of BIND 9. 8384 8385 ``QryDropped`` 8386 This indicates the number of recursive queries dropped by the server as a result of configured limits. These limits include the settings of the :any:`fetches-per-zone`, :any:`fetches-per-server`, :any:`clients-per-query`, and :any:`max-clients-per-query` options, as well as the :any:`rate-limit` option. This corresponds to the ``dropped`` counter of previous versions of BIND 9. 8387 8388 ``QryFailure`` 8389 This indicates the number of query failures. This corresponds to the ``failure`` counter of previous versions of BIND 9. Note: this counter is provided mainly for backward compatibility with previous versions; normally, more fine-grained counters such as ``AuthQryRej`` and ``RecQryRej`` that would also fall into this counter are provided, so this counter is not of much interest in practice. 8390 8391 ``QryNXRedir`` 8392 This indicates the number of queries that resulted in NXDOMAIN that were redirected. 8393 8394 ``QryNXRedirRLookup`` 8395 This indicates the number of queries that resulted in NXDOMAIN that were redirected and resulted in a successful remote lookup. 8396 8397 ``XfrReqDone`` 8398 This indicates the number of requested and completed zone transfers. 8399 8400 ``UpdateReqFwd`` 8401 This indicates the number of forwarded update requests. 8402 8403 ``UpdateRespFwd`` 8404 This indicates the number of forwarded update responses. 8405 8406 ``UpdateFwdFail`` 8407 This indicates the number of forwarded dynamic updates that failed. 8408 8409 ``UpdateDone`` 8410 This indicates the number of completed dynamic updates. 8411 8412 ``UpdateFail`` 8413 This indicates the number of failed dynamic updates. 8414 8415 ``UpdateBadPrereq`` 8416 This indicates the number of dynamic updates rejected due to a prerequisite failure. 8417 8418 ``UpdateQuota`` 8419 This indicates the number of times a dynamic update or update 8420 forwarding request was rejected because the number of pending 8421 requests exceeded :any:`update-quota`. 8422 8423 ``RateDropped`` 8424 This indicates the number of responses dropped due to rate limits. 8425 8426 ``RateSlipped`` 8427 This indicates the number of responses truncated by rate limits. 8428 8429 ``RPZRewrites`` 8430 This indicates the number of response policy zone rewrites. 8431 8432 .. _zone_stats: 8433 8434 Zone Maintenance Statistics Counters 8435 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8436 8437 ``NotifyOutv4`` 8438 This indicates the number of IPv4 notifies sent. 8439 8440 ``NotifyOutv6`` 8441 This indicates the number of IPv6 notifies sent. 8442 8443 ``NotifyInv4`` 8444 This indicates the number of IPv4 notifies received. 8445 8446 ``NotifyInv6`` 8447 This indicates the number of IPv6 notifies received. 8448 8449 ``NotifyRej`` 8450 This indicates the number of incoming notifies rejected. 8451 8452 ``SOAOutv4`` 8453 This indicates the number of IPv4 SOA queries sent. 8454 8455 ``SOAOutv6`` 8456 This indicates the number of IPv6 SOA queries sent. 8457 8458 ``AXFRReqv4`` 8459 This indicates the number of requested IPv4 AXFRs. 8460 8461 ``AXFRReqv6`` 8462 This indicates the number of requested IPv6 AXFRs. 8463 8464 ``IXFRReqv4`` 8465 This indicates the number of requested IPv4 IXFRs. 8466 8467 ``IXFRReqv6`` 8468 This indicates the number of requested IPv6 IXFRs. 8469 8470 ``XfrSuccess`` 8471 This indicates the number of successful zone transfer requests. 8472 8473 ``XfrFail`` 8474 This indicates the number of failed zone transfer requests. 8475 8476 .. _resolver_stats: 8477 8478 Resolver Statistics Counters 8479 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8480 8481 ``Queryv4`` 8482 This indicates the number of IPv4 queries sent. 8483 8484 ``Queryv6`` 8485 This indicates the number of IPv6 queries sent. 8486 8487 ``Responsev4`` 8488 This indicates the number of IPv4 responses received. 8489 8490 ``Responsev6`` 8491 This indicates the number of IPv6 responses received. 8492 8493 ``NXDOMAIN`` 8494 This indicates the number of NXDOMAINs received. 8495 8496 ``SERVFAIL`` 8497 This indicates the number of SERVFAILs received. 8498 8499 ``FORMERR`` 8500 This indicates the number of FORMERRs received. 8501 8502 ``OtherError`` 8503 This indicates the number of other errors received. 8504 8505 ``EDNS0Fail`` 8506 This indicates the number of EDNS(0) query failures. 8507 8508 ``Mismatch`` 8509 This indicates the number of mismatched responses received, meaning the DNS ID, response's source address, and/or the response's source port does not match what was expected. (The port must be 53 or as defined by the :namedconf:ref:`port` option.) This may be an indication of a cache poisoning attempt. 8510 8511 ``Truncated`` 8512 This indicates the number of truncated responses received. 8513 8514 ``Lame`` 8515 This indicates the number of lame delegations received. 8516 8517 ``Retry`` 8518 This indicates the number of query retries performed. 8519 8520 ``QueryAbort`` 8521 This indicates the number of queries aborted due to quota control. 8522 8523 ``QuerySockFail`` 8524 This indicates the number of failures in opening query sockets. One common reason for such failures is due to a limitation on file descriptors. 8525 8526 ``QueryCurUDP`` 8527 This indicates the number of UDP queries in progress. 8528 8529 ``QueryCurTCP`` 8530 This indicates the number of TCP queries in progress. 8531 8532 ``QueryTimeout`` 8533 This indicates the number of query timeouts. 8534 8535 ``GlueFetchv4`` 8536 This indicates the number of IPv4 NS address fetches invoked. 8537 8538 ``GlueFetchv6`` 8539 This indicates the number of IPv6 NS address fetches invoked. 8540 8541 ``GlueFetchv4Fail`` 8542 This indicates the number of failed IPv4 NS address fetches. 8543 8544 ``GlueFetchv6Fail`` 8545 This indicates the number of failed IPv6 NS address fetches. 8546 8547 ``ValAttempt`` 8548 This indicates the number of attempted DNSSEC validations. 8549 8550 ``ValOk`` 8551 This indicates the number of successful DNSSEC validations. 8552 8553 ``ValNegOk`` 8554 This indicates the number of successful DNSSEC validations on negative information. 8555 8556 ``ValFail`` 8557 This indicates the number of failed DNSSEC validations. 8558 8559 ``QryRTTnn`` 8560 This provides a frequency table on query round-trip times (RTTs). Each ``nn`` specifies the corresponding frequency. In the sequence of ``nn_1``, ``nn_2``, ..., ``nn_m``, the value of ``nn_i`` is the number of queries whose RTTs are between ``nn_(i-1)`` (inclusive) and ``nn_i`` (exclusive) milliseconds. For the sake of convenience, we define ``nn_0`` to be 0. The last entry should be represented as ``nn_m+``, which means the number of queries whose RTTs are equal to or greater than ``nn_m`` milliseconds. 8561 8562 ``NumFetch`` 8563 This indicates the number of active fetches. 8564 8565 ``BucketSize`` 8566 This indicates the number of the resolver's internal buckets (a static number). 8567 8568 ``REFUSED`` 8569 This indicates the number of REFUSED responses received. 8570 8571 ``ClientCookieOut`` 8572 This indicates the number of COOKIE messages sent to an authoritative server with only a client cookie. 8573 8574 ``ServerCookieOut`` 8575 This indicates the number of COOKIE messages sent to an authoritative server with both a client and a cached server cookie. 8576 8577 ``CookieIn`` 8578 This indicates the number of COOKIE replies received from an authoritative server. 8579 8580 ``CookieClientOk`` 8581 This indicates the number of correctly formed COOKIE client responses received. 8582 8583 ``BadEDNSVersion`` 8584 This indicates the number of bad EDNS version replies received. 8585 8586 ``BadCookieRcode`` 8587 This indicates the number of BADCOOKIE response codes received from an authoritative server. 8588 8589 ``ZoneQuota`` 8590 This indicates the number of queries spilled for exceeding the :any:`fetches-per-zone` quota. 8591 8592 ``ServerQuota`` 8593 This indicates the number of queries spilled for exceeding the :any:`fetches-per-server` quota. 8594 8595 ``ClientQuota`` 8596 This indicates the number of queries spilled for exceeding the :any:`clients-per-query` quota. 8597 8598 ``NextItem`` 8599 This indicates the number of times the server waited for the next item after receiving an invalid response. 8600 8601 ``Priming`` 8602 This indicates the number of priming fetches performed by the resolver. 8603 8604 .. _socket_stats: 8605 8606 Socket I/O Statistics Counters 8607 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8608 8609 Socket I/O statistics counters are defined per socket type, which are 8610 ``UDP4`` (UDP/IPv4), ``UDP6`` (UDP/IPv6), ``TCP4`` (TCP/IPv4), and ``TCP6`` 8611 (TCP/IPv6). In the following list, ``<TYPE>`` represents 8612 a socket type. Not all counters are available for all socket types; 8613 exceptions are noted in the descriptions. 8614 8615 ``<TYPE>Open`` 8616 This indicates the number of sockets opened successfully. 8617 8618 ``<TYPE>OpenFail`` 8619 This indicates the number of failures to open sockets. 8620 8621 ``<TYPE>Close`` 8622 This indicates the number of closed sockets. 8623 8624 ``<TYPE>BindFail`` 8625 This indicates the number of failures to bind sockets. 8626 8627 ``<TYPE>ConnFail`` 8628 This indicates the number of failures to connect sockets. 8629 8630 ``<TYPE>Conn`` 8631 This indicates the number of connections established successfully. 8632 8633 ``<TYPE>AcceptFail`` 8634 This indicates the number of failures to accept incoming connection requests. This counter does not apply to the ``UDP`` type. 8635 8636 ``<TYPE>Accept`` 8637 This indicates the number of incoming connections successfully accepted. This counter does not apply to the ``UDP`` type. 8638 8639 ``<TYPE>SendErr`` 8640 This indicates the number of errors in socket send operations. 8641 8642 ``<TYPE>RecvErr`` 8643 This indicates the number of errors in socket receive operations, including errors of send operations on a connected UDP socket, notified by an ICMP error message. 8644