]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/recursordist/docs/settings.rst
Merge pull request #9079 from omoerbeek/coverity-1428667
[thirdparty/pdns.git] / pdns / recursordist / docs / settings.rst
1 PowerDNS Recursor Settings
2 ==========================
3 Each setting can appear on the command line, prefixed by '--', or in the configuration file.
4 The command line overrides the configuration file.
5
6 **Note**: Settings marked as 'Boolean' can either be set to an empty value, which means on, or to 'no' or 'off' which means off.
7 Anything else means on.
8
9 As an example:
10
11 - ``serve-rfc1918`` on its own means: do serve those zones.
12 - ``serve-rfc1918=off`` or ``serve-rfc1918=no`` means: do not serve those zones.
13 - Anything else means: do serve those zones.
14
15 .. _setting-allow-from:
16
17 ``allow-from``
18 --------------
19 - IP ranges, separated by commas
20 - Default: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
21
22 Netmasks (both IPv4 and IPv6) that are allowed to use the server.
23 The default allows access only from :rfc:`1918` private IP addresses.
24 Due to the aggressive nature of the internet these days, it is highly recommended to not open up the recursor for the entire internet.
25 Questions from IP addresses not listed here are ignored and do not get an answer.
26
27 When the Proxy Protocol is enabled (see `proxy-protocol-from`_), the recursor will check the address of the client IP advertised in the Proxy Protocol header instead of the one of the proxy.
28
29 .. _setting-allow-from-file:
30
31 ``allow-from-file``
32 -------------------
33 - Path
34
35 Like `allow-from`_, except reading from file.
36 Overrides the `allow-from`_ setting. To use this feature, supply one netmask per line, with optional comments preceded by a "#".
37
38 .. _setting-any-to-tcp:
39
40 ``any-to-tcp``
41 --------------
42 - Boolean
43 - Default: no
44
45 Answer questions for the ANY type on UDP with a truncated packet that refers the remote server to TCP.
46 Useful for mitigating ANY reflection attacks.
47
48 .. _setting-allow-trust-anchor-query:
49
50 ``allow-trust-anchor-query``
51 ----------------------------
52 .. versionadded:: 4.3.0
53
54 - Boolean
55 - Default: no
56
57 Allow ``trustanchor.server CH TXT`` and ``negativetrustanchor.server CH TXT`` queries to view the configured :doc:`DNSSEC <dnssec>` (negative) trust anchors.
58
59 .. _setting-api-config-dir:
60
61 ``api-config-dir``
62 ------------------
63 .. versionadded:: 4.0.0
64
65 - Path
66 - Default: unset
67
68 Directory where the REST API stores its configuration and zones.
69
70 .. _setting-api-key:
71
72 ``api-key``
73 -----------
74 .. versionadded:: 4.0.0
75
76 - String
77 - Default: unset
78
79 Static pre-shared authentication key for access to the REST API.
80
81 .. _setting-api-readonly:
82
83 ``api-readonly``
84 ----------------
85 .. versionchanged:: 4.2.0
86 This setting has been removed.
87
88 - Boolean
89 - Default: no
90
91 Disallow data modification through the REST API when set.
92
93 .. _setting-api-logfile:
94
95 ``api-logfile``
96 ---------------
97 .. versionchanged:: 4.2.0
98 This setting has been removed.
99
100 - Path
101 - Default: unset
102
103 Location of the server logfile (used by the REST API).
104
105 .. _setting-auth-can-lower-ttl:
106
107 ``auth-can-lower-ttl``
108 ----------------------
109 - Boolean
110 - Default: no
111
112 Authoritative zones can transmit a TTL value that is lower than that specified in the parent zone.
113 This is called a 'delegation inconsistency'.
114 To follow :rfc:`RFC 2181 section 5.2<2181#section-5.2>` and :rfc:`5.4 <2181#section-5.4>` to the letter, enable this feature.
115 This will mean a slight deterioration of performance, and it will not solve any problems, but does make the recursor more standards compliant.
116 Not recommended unless you have to tick an 'RFC 2181 compliant' box.
117
118 .. _setting-auth-zones:
119
120 ``auth-zones``
121 --------------
122 - Comma separated list of 'zonename=filename' pairs
123
124 Zones read from these files (in BIND format) are served authoritatively.
125 DNSSEC is not supported. Example:
126
127 .. code-block:: none
128
129 auth-zones=example.org=/var/zones/example.org, powerdns.com=/var/zones/powerdns.com
130
131 .. _setting-carbon-interval:
132
133 ``carbon-interval``
134 -------------------
135 - Integer
136 - Default: 30
137
138 If sending carbon updates, this is the interval between them in seconds.
139 See :doc:`metrics`.
140
141 .. _setting-carbon-namespace:
142
143 ``carbon-namespace``
144 --------------------
145 .. versionadded:: 4.2.0
146
147 - String
148
149 Change the namespace or first string of the metric key. The default is pdns.
150
151 .. _setting-carbon-ourname:
152
153 ``carbon-ourname``
154 ------------------
155 - String
156
157 If sending carbon updates, if set, this will override our hostname.
158 Be careful not to include any dots in this setting, unless you know what you are doing.
159 See :ref:`metricscarbon`.
160
161 .. _setting-carbon-instance:
162
163 ``carbon-instance``
164 --------------------
165 .. versionadded:: 4.2.0
166
167 - String
168
169 Change the instance or third string of the metric key. The default is recursor.
170
171 .. _setting-carbon-server:
172
173 ``carbon-server``
174 -----------------
175 - IP address
176
177 If set to an IP or IPv6 address, will send all available metrics to this server via the carbon protocol, which is used by graphite and metronome. Moreover you can specify more than one server using a comma delimited list, ex: carbon-server=10.10.10.10,10.10.10.20.
178 You may specify an alternate port by appending :port, for example: ``127.0.0.1:2004``.
179 See :doc:`metrics`.
180
181 .. _setting-chroot:
182
183 ``chroot``
184 ----------
185 - Path to a Directory
186
187 If set, chroot to this directory for more security.
188 See :doc:`security`
189
190 Make sure that ``/dev/log`` is available from within the chroot.
191 Logging will silently fail over time otherwise (on logrotate).
192
193 When using ``chroot``, all other paths (except for `config-dir`_) set in the configuration are relative to the new root.
194
195 When using ``chroot`` and the API (`webserver`_), `api-readonly`_ **must** be set and `api-config-dir`_ unset.
196
197 When running on a system where systemd manages services, ``chroot`` does not work out of the box, as PowerDNS cannot use the ``NOTIFY_SOCKET``.
198 Either do not ``chroot`` on these systems or set the 'Type' of this service to 'simple' instead of 'notify' (refer to the systemd documentation on how to modify unit-files).
199
200 .. _setting-client-tcp-timeout:
201
202 ``client-tcp-timeout``
203 ----------------------
204 - Integer
205 - Default: 2
206
207 Time to wait for data from TCP clients.
208
209 .. _setting-config-dir:
210
211 ``config-dir``
212 --------------
213 - Path
214
215 Location of configuration directory (``recursor.conf``).
216 Usually ``/etc/powerdns``, but this depends on ``SYSCONFDIR`` during compile-time.
217
218 .. _setting-config-name:
219
220 ``config-name``
221 ---------------
222 - String
223 - Default: unset
224
225 When running multiple recursors on the same server, read settings from :file:`recursor-{name}.conf`, this will also rename the binary image.
226
227 .. _setting-cpu-map:
228
229 ``cpu-map``
230 -----------
231 .. versionadded:: 4.1.0
232
233 - String
234 - Default: unset
235
236 Set CPU affinity for worker threads, asking the scheduler to run those threads on a single CPU, or a set of CPUs.
237 This parameter accepts a space separated list of thread-id=cpu-id, or thread-id=cpu-id-1,cpu-id-2,...,cpu-id-N.
238 For example, to make the worker thread 0 run on CPU id 0 and the worker thread 1 on CPUs 1 and 2::
239
240 cpu-map=0=0 1=1,2
241
242 The number of worker threads is determined by the :ref:`setting-threads` setting.
243 If :ref:`setting-pdns-distributes-queries` is set, an additional thread is started, assigned the id 0,
244 and is the only one listening on client sockets and accepting queries, distributing them to the other worker threads afterwards.
245
246 Starting with version 4.2.0, the thread handling the control channel, the webserver and other internal stuff has been assigned
247 id 0 and more than one distributor thread can be started using the :ref:`setting-distributor-threads` setting, so the distributor
248 threads if any are assigned id 1 and counting, and the other threads follow behind.
249
250 This parameter is only available on OS that provides the `pthread_setaffinity_np()` function.
251
252 .. _setting-daemon:
253
254 ``daemon``
255 ----------
256 - Boolean
257 - Default: no
258
259 .. versionchanged:: 4.0.0
260
261 Default is now "no", was "yes" before.
262
263 Operate in the background.
264
265 .. _setting-delegation-only:
266
267 ``delegation-only``
268 -------------------
269 - Domains, comma separated
270
271 Which domains we only accept delegations from (a Verisign special).
272
273 .. _setting-dont-throttle-names:
274
275 ``dont-throttle-names``
276 ----------------------------
277 .. versionadded:: 4.2.0
278
279 - Comma separated list of domain-names
280 - Default: (empty)
281
282 When an authoritative server does not answer a query or sends a reply the recursor does not like, it is throttled.
283 Any servers' name suffix-matching the supplied names will never be throttled.
284
285 .. warning::
286 Most servers on the internet do not respond for a good reason (overloaded or unreachable), ``dont-throttle-names`` could make this load on the upstream server even higher, resulting in further service degradation.
287
288 .. _setting-dont-throttle-netmasks:
289
290 ``dont-throttle-netmasks``
291 ----------------------------
292 .. versionadded:: 4.2.0
293
294 - Comma separated list of netmasks
295 - Default: (empty)
296
297 When an authoritative server does not answer a query or sends a reply the recursor does not like, it is throttled.
298 Any servers matching the supplied netmasks will never be throttled.
299
300 This can come in handy on lossy networks when forwarding, where the same server is configured multiple times (e.g. with ``forward-zones-recurse=example.com=192.0.2.1;192.0.2.1``).
301 By default, the PowerDNS Recursor would throttle the "first" server on a timeout and hence not retry the "second" one.
302 In this case, ``dont-throttle-netmasks`` could be set to ``192.0.2.1``.
303
304 .. warning::
305 Most servers on the internet do not respond for a good reason (overloaded or unreachable), ``dont-throttle-netmasks`` could make this load on the upstream server even higher, resulting in further service degradation.
306
307 .. _setting-disable-packetcache:
308
309 ``disable-packetcache``
310 -----------------------
311 - Boolean
312 - Default: no
313
314 Turn off the packet cache. Useful when running with Lua scripts that can
315 not be cached.
316
317 .. _setting-disable-syslog:
318
319 ``disable-syslog``
320 ------------------
321 - Boolean
322 - Default: no
323
324 Do not log to syslog, only to stdout.
325 Use this setting when running inside a supervisor that handles logging (like systemd).
326 **Note**: do not use this setting in combination with `daemon`_ as all logging will disappear.
327
328 .. _setting-distribution-load-factor:
329
330 ``distribution-load-factor``
331 ----------------------------
332 .. versionadded:: 4.1.12
333
334 - Double
335 - Default: 0.0
336
337 If `pdns-distributes-queries`_ is set and this setting is set to another value
338 than 0, the distributor thread will use a bounded load-balancing algorithm while
339 distributing queries to worker threads, making sure that no thread is assigned
340 more queries than distribution-load-factor times the average number of queries
341 currently processed by all the workers.
342 For example, with a value of 1.25, no server should get more than 125 % of the
343 average load. This helps making sure that all the workers have roughly the same
344 share of queries, even if the incoming traffic is very skewed, with a larger
345 number of requests asking for the same qname.
346
347 .. _setting-distribution-pipe-buffer-size:
348
349 ``distribution-pipe-buffer-size``
350 ---------------------------------
351 .. versionadded:: 4.2.0
352
353 - Integer
354 - Default: 0
355
356 Size in bytes of the internal buffer of the pipe used by the distributor to pass incoming queries to a worker thread.
357 Requires support for `F_SETPIPE_SZ` which is present in Linux since 2.6.35. The actual size might be rounded up to
358 a multiple of a page size. 0 means that the OS default size is used.
359 A large buffer might allow the recursor to deal with very short-lived load spikes during which a worker thread gets
360 overloaded, but it will be at the cost of an increased latency.
361
362 .. _setting-distributor-threads:
363
364 ``distributor-threads``
365 -----------------------
366 .. versionadded:: 4.2.0
367
368 - Integer
369 - Default: 1 if `pdns-distributes-queries`_ is set, 0 otherwise
370
371 If `pdns-distributes-queries`_ is set, spawn this number of distributor threads on startup. Distributor threads
372 handle incoming queries and distribute them to other threads based on a hash of the query, to maximize the cache hit
373 ratio.
374
375 .. _setting-dns64-prefix:
376
377 ``dns64-prefix``
378 ----------------
379 .. versionadded:: 4.4.0
380
381 - Netmask, as a string
382 - Default: None
383
384 Enable DNS64 (:rfc:`6147`) support using the supplied /96 IPv6 prefix. This will generate 'fake' AAAA records for names
385 with only `A` records, as well as 'fake' PTR records to make sure that reverse lookup of DNS64-generated IPv6 addresses
386 generate the right name.
387 See :doc:`dns64` for more flexible but slower alternatives using Lua.
388
389 .. _setting-dnssec:
390
391 ``dnssec``
392 ----------
393 .. versionadded:: 4.0.0
394
395 - One of ``off``, ``process-no-validate``, ``process``, ``log-fail``, ``validate``, String
396 - Default: ``process-no-validate``
397
398 Set the mode for DNSSEC processing:
399
400 off
401 ^^^
402 No DNSSEC processing whatsoever.
403 Ignore DO-bits in queries, don't request any DNSSEC information from authoritative servers.
404 This behaviour is similar to PowerDNS Recursor pre-4.0.
405
406 process-no-validate
407 ^^^^^^^^^^^^^^^^^^^
408 Respond with DNSSEC records to clients that ask for it, set the DO bit on all outgoing queries.
409 Don't do any validation.
410
411 process
412 ^^^^^^^
413 Respond with DNSSEC records to clients that ask for it, set the DO bit on all outgoing queries.
414 Do validation for clients that request it (by means of the AD- bit or DO-bit in the query).
415
416 log-fail
417 ^^^^^^^^
418 Similar behaviour to ``process``, but validate RRSIGs on responses and log bogus responses.
419
420 validate
421 ^^^^^^^^
422 Full blown DNSSEC validation. Send SERVFAIL to clients on bogus responses.
423
424 .. _setting-dnssec-log-bogus:
425
426 ``dnssec-log-bogus``
427 --------------------
428 - Boolean
429 - Default: no
430
431 Log every DNSSEC validation failure.
432 **Note**: This is not logged per-query but every time records are validated as Bogus.
433
434 .. _setting-dont-query:
435
436 ``dont-query``
437 --------------
438 - Netmasks, comma separated
439 - Default: 127.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fc00::/7, fe80::/10, 0.0.0.0/8, 192.0.0.0/24, 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::/96, ::ffff:0:0/96, 100::/64, 2001:db8::/32
440
441 The DNS is a public database, but sometimes contains delegations to private IP addresses, like for example 127.0.0.1.
442 This can have odd effects, depending on your network, and may even be a security risk.
443 Therefore, the PowerDNS Recursor by default does not query private space IP addresses.
444 This setting can be used to expand or reduce the limitations.
445
446 Queries to addresses for zones as configured in any of the settings `forward-zones`_, `forward-zones-file`_ or `forward-zones-recurse`_ are performed regardless of these limitations.
447
448 .. _setting-ecs-add-for:
449
450 ``ecs-add-for``
451 ---------------
452 .. versionadded:: 4.2.0
453
454 - Comma separated list of netmasks
455 - Default: 0.0.0.0/0, ::/0, !127.0.0.0/8, !10.0.0.0/8, !100.64.0.0/10, !169.254.0.0/16, !192.168.0.0/16, !172.16.0.0/12, !::1/128, !fc00::/7, !fe80::/10
456
457 List of requestor netmasks for which the requestor IP Address should be used as the :rfc:`EDNS Client Subnet <7871>` for outgoing queries. Outgoing queries for requestors that do not match this list will use the `ecs-scope-zero-address`_ instead.
458 Valid incoming ECS values from `use-incoming-edns-subnet`_ are not replaced.
459
460 Regardless of the value of this setting, ECS values are only sent for outgoing queries matching the conditions in the `edns-subnet-whitelist`_ setting. This setting only controls the actual value being sent.
461
462 This defaults to not using the requestor address inside RFC1918 and similar "private" IP address spaces.
463
464 .. _setting-ecs-ipv4-bits:
465
466 ``ecs-ipv4-bits``
467 -----------------
468 .. versionadded:: 4.1.0
469
470 - Integer
471 - Default: 24
472
473 Number of bits of client IPv4 address to pass when sending EDNS Client Subnet address information.
474
475 .. _setting-ecs-ipv4-cache-bits:
476
477 ``ecs-ipv4-cache-bits``
478 -----------------------
479 .. versionadded:: 4.1.12
480
481 - Integer
482 - Default: 24
483
484 Maximum number of bits of client IPv4 address used by the authoritative server (as indicated by the EDNS Client Subnet scope in the answer) for an answer to be inserted into the query cache. This condition applies in conjunction with ``ecs-cache-limit-ttl``.
485 That is, only if both the limits apply, the record will not be cached.
486
487 .. _setting-ecs-ipv6-bits:
488
489 ``ecs-ipv6-bits``
490 -----------------
491 .. versionadded:: 4.1.0
492
493 - Integer
494 - Default: 56
495
496 Number of bits of client IPv6 address to pass when sending EDNS Client Subnet address information.
497
498 .. _setting-ecs-ipv6-cache-bits:
499
500 ``ecs-ipv6-cache-bits``
501 -----------------------
502 .. versionadded:: 4.1.12
503
504 - Integer
505 - Default: 56
506
507 Maximum number of bits of client IPv6 address used by the authoritative server (as indicated by the EDNS Client Subnet scope in the answer) for an answer to be inserted into the query cache. This condition applies in conjunction with ``ecs-cache-limit-ttl``.
508 That is, only if both the limits apply, the record will not be cached.
509
510 .. _setting-ecs-minimum-ttl-override:
511
512 ``ecs-minimum-ttl-override``
513 ----------------------------
514 - Integer
515 - Default: 0 (disabled)
516
517 This setting artificially raises the TTLs of records in the ANSWER section of ECS-specific answers to be at least this long.
518 While this is a gross hack, and violates RFCs, under conditions of DoS, it may enable you to continue serving your customers.
519 Can be set at runtime using ``rec_control set-ecs-minimum-ttl 3600``.
520
521 .. _setting-ecs-cache-limit-ttl:
522
523 ``ecs-cache-limit-ttl``
524 -----------------------
525 .. versionadded:: 4.1.12
526
527 - Integer
528 - Default: 0 (disabled)
529
530 The minimum TTL for an ECS-specific answer to be inserted into the query cache. This condition applies in conjunction with ``ecs-ipv4-cache-bits`` or ``ecs-ipv6-cache-bits``.
531 That is, only if both the limits apply, the record will not be cached.
532
533 .. _setting-ecs-scope-zero-address:
534
535 ``ecs-scope-zero-address``
536 --------------------------
537 .. versionadded:: 4.1.0
538
539 - IPv4 or IPv6 Address
540 - Default: empty
541
542 The IP address sent via EDNS Client Subnet to authoritative servers listed in
543 `edns-subnet-whitelist`_ when `use-incoming-edns-subnet`_ is set and the query has
544 an ECS source prefix-length set to 0.
545 The default is to look for the first usable (not an ``any`` one) address in
546 `query-local-address`_ then `query-local-address6`_. If no suitable address is
547 found, the recursor fallbacks to sending 127.0.0.1.
548
549 .. _setting-edns-outgoing-bufsize:
550
551 ``edns-outgoing-bufsize``
552 -------------------------
553 .. versionchanged:: 4.2.0
554 Before 4.2.0, the default was 1680
555
556 - Integer
557 - Default: 1232
558
559 .. note:: Why 1232?
560
561 1232 is the largest number of payload bytes that can fit in the smallest IPv6 packet.
562 IPv6 has a minimum MTU of 1280 bytes (:rfc:`RFC 8200, section 5 <8200#section-5>`), minus 40 bytes for the IPv6 header, minus 8 bytes for the UDP header gives 1232, the maximum payload size for the DNS response.
563
564 This is the value set for the EDNS0 buffer size in outgoing packets.
565 Lower this if you experience timeouts.
566
567 .. _setting-edns-subnet-whitelist:
568
569 ``edns-subnet-whitelist``
570 -------------------------
571 - Comma separated list of domain names and netmasks
572 - Default: (none)
573
574 List of netmasks and domains that :rfc:`EDNS Client Subnet <7871>` should be enabled for in outgoing queries.
575
576 For example, an EDNS Client Subnet option containing the address of the initial requestor (but see `ecs-add-for`_) will be added to an outgoing query sent to server 192.0.2.1 for domain X if 192.0.2.1 matches one of the supplied netmasks, or if X matches one of the supplied domains.
577 The initial requestor address will be truncated to 24 bits for IPv4 (see `ecs-ipv4-bits`_) and to 56 bits for IPv6 (see `ecs-ipv6-bits`_), as recommended in the privacy section of RFC 7871.
578
579 By default, this option is empty, meaning no EDNS Client Subnet information is sent.
580
581 .. _setting-entropy-source:
582
583 ``entropy-source``
584 ------------------
585 - Path
586 - Default: /dev/urandom
587
588 PowerDNS can read entropy from a (hardware) source.
589 This is used for generating random numbers which are very hard to predict.
590 Generally on UNIX platforms, this source will be ``/dev/urandom``, which will always supply random numbers, even if entropy is lacking.
591 Change to ``/dev/random`` if PowerDNS should block waiting for enough entropy to arrive.
592
593 .. _setting-etc-hosts-file:
594
595 ``etc-hosts-file``
596 ------------------
597 - Path
598 - Default: /etc/hosts
599
600 The path to the /etc/hosts file, or equivalent.
601 This file can be used to serve data authoritatively using `export-etc-hosts`_.
602
603 .. _setting-export-etc-hosts:
604
605 ``export-etc-hosts``
606 --------------------
607 - Boolean
608 - Default: no
609
610 If set, this flag will export the host names and IP addresses mentioned in ``/etc/hosts``.
611
612 .. _setting-export-etc-hosts-search-suffix:
613
614 ``export-etc-hosts-search-suffix``
615 ----------------------------------
616 - String
617
618 If set, all hostnames in the `export-etc-hosts`_ file are loaded in canonical form, based on this suffix, unless the name contains a '.', in which case the name is unchanged.
619 So an entry called 'pc' with ``export-etc-hosts-search-suffix='home.com'`` will lead to the generation of 'pc.home.com' within the recursor.
620 An entry called 'server1.home' will be stored as 'server1.home', regardless of this setting.
621
622 .. _setting-forward-zones:
623
624 ``forward-zones``
625 -----------------
626 - 'zonename=IP' pairs, comma separated
627
628 Queries for zones listed here will be forwarded to the IP address listed. i.e.
629
630 .. code-block:: none
631
632 forward-zones=example.org=203.0.113.210, powerdns.com=2001:DB8::BEEF:5
633
634 Multiple IP addresses can be specified and port numbers other than 53 can be configured:
635
636 .. code-block:: none
637
638 forward-zones=example.org=203.0.113.210:5300;127.0.0.1, powerdns.com=127.0.0.1;198.51.100.10:530;[2001:DB8::1:3]:5300
639
640 Forwarded queries have the 'recursion desired' bit set to 0, meaning that this setting is intended to forward queries to authoritative servers.
641
642 **IMPORTANT**: When using DNSSEC validation (which is default), forwards to non-delegated (e.g. internal) zones that have a DNSSEC signed parent zone will validate as Bogus.
643 To prevent this, add a Negative Trust Anchor (NTA) for this zone in the `lua-config-file`_ with ``addNTA("your.zone", "A comment")``.
644 If this forwarded zone is signed, instead of adding NTA, add the DS record to the `lua-config-file`_.
645 See the :doc:`dnssec` information.
646
647 .. _setting-forward-zones-file:
648
649 ``forward-zones-file``
650 ----------------------
651 - Path
652
653 Same as `forward-zones`_, parsed from a file. Only 1 zone is allowed per line, specified as follows:
654
655 .. code-block:: none
656
657 example.org=203.0.113.210, 192.0.2.4:5300
658
659 Zones prefixed with a '+' are forwarded with the recursion-desired bit set, for which see `forward-zones-recurse`_.
660 Default behaviour without '+' is as with `forward-zones`_.
661
662 .. versionchanged:: 4.0.0
663
664 Comments are allowed, everything behind '#' is ignored.
665
666 The DNSSEC notes from `forward-zones`_ apply here as well.
667
668 .. _setting-forward-zones-recurse:
669
670 ``forward-zones-recurse``
671 -------------------------
672 - 'zonename=IP' pairs, comma separated
673
674 Like regular `forward-zones`_, but forwarded queries have the 'recursion desired' bit set to 1, meaning that this setting is intended to forward queries to other recursive servers.
675
676 The DNSSEC notes from `forward-zones`_ apply here as well.
677
678 .. _setting-gettag-needs-edns-options:
679
680 ``gettag-needs-edns-options``
681 -----------------------------
682 .. versionadded:: 4.1.0
683
684 - Boolean
685 - Default: no
686
687 If set, EDNS options in incoming queries are extracted and passed to the :func:`gettag` hook in the ``ednsoptions`` table.
688
689 .. _setting-hint-file:
690
691 ``hint-file``
692 -------------
693 - Path
694
695 If set, the root-hints are read from this file. If unset, default root hints are used.
696
697 .. _setting-include-dir:
698
699 ``include-dir``
700 ---------------
701 - Path
702
703 Directory to scan for additional config files. All files that end with .conf are loaded in order using ``POSIX`` as locale.
704
705 .. _setting-latency-statistic-size:
706
707 ``latency-statistic-size``
708 --------------------------
709 - Integer
710 - Default: 10000
711
712 Indication of how many queries will be averaged to get the average latency reported by the 'qa-latency' metric.
713
714 .. _setting-local-address:
715
716 ``local-address``
717 -----------------
718 - IP addresses, comma separated
719 - Default: 127.0.0.1
720
721 Local IPv4 or IPv6 addresses to bind to.
722 Addresses can also contain port numbers, for IPv4 specify like this: ``192.0.2.4:5300``, for IPv6: ``[::1]:5300``.
723
724 **Warning**: When binding to wildcard addresses, UNIX semantics mean that answers may not be sent from the address a query was received on.
725 It is highly recommended to bind to explicit addresses.
726
727 .. _setting-local-port:
728
729 ``local-port``
730 --------------
731 - Integer
732 - Default: 53
733
734 Local port to bind to.
735 If an address in `local-address`_ does not have an explicit port, this port is used.
736
737 .. _setting-log-timestamp:
738
739 ``log-timestamp``
740 -----------------
741
742 .. versionadded:: 4.1.0
743
744 - Bool
745 - Default: yes
746
747 When printing log lines to stdout, prefix them with timestamps.
748 Disable this if the process supervisor timestamps these lines already.
749
750 .. note::
751 The systemd unit file supplied with the source code already disables timestamp printing
752
753 .. _setting-non-local-bind:
754
755 ``non-local-bind``
756 ------------------
757 - Boolean
758 - Default: no
759
760 Bind to addresses even if one or more of the `local-address`_'s do not exist on this server.
761 Setting this option will enable the needed socket options to allow binding to non-local addresses.
762 This feature is intended to facilitate ip-failover setups, but it may also mask configuration issues and for this reason it is disabled by default.
763
764 .. _setting-loglevel:
765
766 ``loglevel``
767 ------------
768 - Integer between 0 and 9
769 - Default: 6
770
771 Amount of logging.
772 Higher is more, more logging may destroy performance.
773 It is recommended not to set this below 3.
774
775 .. _setting-log-common-errors:
776
777 ``log-common-errors``
778 ---------------------
779 - Boolean
780 - Default: no
781
782 Some DNS errors occur rather frequently and are no cause for alarm.
783
784 ``log-rpz-changes``
785 -------------------
786 .. versionadded:: 4.1.0
787
788 - Boolean
789 - Default: no
790
791 Log additions and removals to RPZ zones at Info (6) level instead of Debug (7).
792
793 .. _setting-logging-facility:
794
795 ``logging-facility``
796 --------------------
797 - Integer
798
799 If set to a digit, logging is performed under this LOCAL facility.
800 See :ref:`logging`.
801 Do not pass names like 'local0'!
802
803 .. _setting-lowercase-outgoing:
804
805 ``lowercase-outgoing``
806 ----------------------
807 - Boolean
808 - Default: no
809
810 Set to true to lowercase the outgoing queries.
811 When set to 'no' (the default) a query from a client using mixed case in the DNS labels (such as a user entering mixed-case names or `draft-vixie-dnsext-dns0x20-00 <http://tools.ietf.org/html/draft-vixie-dnsext-dns0x20-00>`_), PowerDNS preserves the case of the query.
812 Broken authoritative servers might give a wrong or broken answer on this encoding.
813 Setting ``lowercase-outgoing`` to 'yes' makes the PowerDNS Recursor lowercase all the labels in the query to the authoritative servers, but still return the proper case to the client requesting.
814
815 .. _setting-lua-config-file:
816
817 ``lua-config-file``
818 -------------------
819 - Filename
820
821 If set, and Lua support is compiled in, this will load an additional configuration file for newer features and more complicated setups.
822 See :doc:`lua-config/index` for the options that can be set in this file.
823
824 .. _setting-lua-dns-script:
825
826 ``lua-dns-script``
827 ------------------
828 - Path
829 - Default: unset
830
831 Path to a lua file to manipulate the Recursor's answers. See :doc:`lua-scripting/index` for more information.
832
833 .. _setting-maintenance-interval:
834
835 ``lua-maintenance-interval``
836 ----------------------------
837 .. versionadded:: 4.2.0
838
839 - Integer
840 - Default: 1
841
842
843 The interval between calls to the Lua user defined `maintenance()` function in seconds.
844 See :ref:`hooks-maintenance-callback`
845
846 .. _setting-max-cache-bogus-ttl:
847
848 ``max-cache-bogus-ttl``
849 -----------------------
850 .. versionadded:: 4.2.0
851
852 - Integer
853 - Default: 3600
854
855 Maximum number of seconds to cache an item in the DNS cache (negative or positive) if its DNSSEC validation failed, no matter what the original TTL specified, to reduce the impact of a broken domain.
856
857 .. _setting-max-cache-entries:
858
859 ``max-cache-entries``
860 ---------------------
861 - Integer
862 - Default: 1000000
863
864 Maximum number of DNS cache entries.
865 1 million per thread will generally suffice for most installations.
866
867 .. _setting-max-cache-ttl:
868
869 ``max-cache-ttl``
870 -----------------
871 - Integer
872 - Default: 86400
873
874 Maximum number of seconds to cache an item in the DNS cache, no matter what the original TTL specified.
875
876 .. versionchanged:: 4.1.0
877
878 The minimum value of this setting is 15. i.e. setting this to lower than 15 will make this value 15.
879
880 .. _setting max-concurrent-requests-per-tcp-connection:
881
882 ``max-concurrent-requests-per-tcp-connection``
883 ----------------------------------------------
884
885 .. versionadded:: 4.3.0
886
887 - Integer
888 - Default: 10
889
890 Maximum number of incoming requests handled concurrently per tcp
891 connection. This number must be larger than 0 and smaller than 65536
892 and also smaller than `max-mthreads`.
893
894 .. _setting-max-generate-steps:
895
896 ``max-generate-steps``
897 ----------------------
898
899 .. versionadded:: 4.3.0
900
901 - Integer
902 - Default: 0
903
904 Maximum number of steps for a '$GENERATE' directive when parsing a
905 zone file. This is a protection measure to prevent consuming a lot of
906 CPU and memory when untrusted zones are loaded. Default to 0 which
907 means unlimited.
908
909 .. _setting-max-mthreads:
910
911 ``max-mthreads``
912 ----------------
913 - Integer
914 - Default: 2048
915
916 Maximum number of simultaneous MTasker threads.
917
918 .. _setting-max-packetcache-entries:
919
920 ``max-packetcache-entries``
921 ---------------------------
922 - Integer
923 - Default: 500000
924
925 Maximum number of Packet Cache entries.
926 1 million per thread will generally suffice for most installations.
927
928 .. _setting-max-qperq:
929
930 ``max-qperq``
931 -------------
932 - Integer
933 - Default: 60
934
935 The maximum number of outgoing queries that will be sent out during the resolution of a single client query.
936 This is used to limit endlessly chasing CNAME redirections.
937 If qname-minimization is enabled, the number will be forced to be 100
938 at a minimum to allow for the extra queries qname-minimization generates when the cache is empty.
939
940 .. _setting-max-negative-ttl:
941
942 ``max-negative-ttl``
943 --------------------
944 - Integer
945 - Default: 3600
946
947 A query for which there is authoritatively no answer is cached to quickly deny a record's existence later on, without putting a heavy load on the remote server.
948 In practice, caches can become saturated with hundreds of thousands of hosts which are tried only once.
949 This setting, which defaults to 3600 seconds, puts a maximum on the amount of time negative entries are cached.
950
951 .. _setting-max-recursion-depth:
952
953 ``max-recursion-depth``
954 -----------------------
955 - Integer
956 - Default: 40
957
958 Total maximum number of internal recursion calls the server may use to answer a single query.
959 0 means unlimited.
960 The value of `stack-size`_ should be increased together with this one to prevent the stack from overflowing.
961
962 .. versionchanged:: 4.1.0
963
964 Before 4.1.0, this settings was unlimited.
965
966 .. _setting-max-tcp-clients:
967
968 ``max-tcp-clients``
969 -------------------
970 - Integer
971 - Default: 128
972
973 Maximum number of simultaneous incoming TCP connections allowed.
974
975 .. _setting-max-tcp-per-client:
976
977 ``max-tcp-per-client``
978 ----------------------
979 - Integer
980 - Default: 0 (unlimited)
981
982 Maximum number of simultaneous incoming TCP connections allowed per client (remote IP address).
983
984 .. _setting-max-tcp-queries-per-connection:
985
986 ``max-tcp-queries-per-connection``
987 ----------------------------------
988 .. versionadded:: 4.1.0
989
990 - Integer
991 - Default: 0 (unlimited)
992
993 Maximum number of DNS queries in a TCP connection.
994
995 .. _setting-max-total-msec:
996
997 ``max-total-msec``
998 ------------------
999 - Integer
1000 - Default: 7000
1001
1002 Total maximum number of milliseconds of wallclock time the server may use to answer a single query.
1003
1004 .. _setting-max-udp-queries-per-round:
1005
1006 ``max-udp-queries-per-round``
1007 ----------------------------------
1008 .. versionadded:: 4.1.4
1009
1010 - Integer
1011 - Default: 10000
1012
1013 Under heavy load the recursor might be busy processing incoming UDP queries for a long while before there is no more of these, and might therefore
1014 neglect scheduling new ``mthreads``, handling responses from authoritative servers or responding to :doc:`rec_control <manpages/rec_control.1>`
1015 requests.
1016 This setting caps the maximum number of incoming UDP DNS queries processed in a single round of looping on ``recvmsg()`` after being woken up by the multiplexer, before
1017 returning back to normal processing and handling other events.
1018
1019 .. _setting-minimum-ttl-override:
1020
1021 ``minimum-ttl-override``
1022 ------------------------
1023 - Integer
1024 - Default: 0 (disabled)
1025
1026 This setting artificially raises all TTLs to be at least this long.
1027 While this is a gross hack, and violates RFCs, under conditions of DoS, it may enable you to continue serving your customers.
1028 Can be set at runtime using ``rec_control set-minimum-ttl 3600``.
1029
1030 .. _setting-new-domain-tracking:
1031
1032 ``new-domain-tracking``
1033 -----------------------
1034 .. versionadded:: 4.2.0
1035
1036 - Boolean
1037 - Default: no (disabled)
1038
1039 Whether to track newly observed domains, i.e. never seen before. This
1040 is a probabilistic algorithm, using a stable bloom filter to store
1041 records of previously seen domains. When enabled for the first time,
1042 all domains will appear to be newly observed, so the feature is best
1043 left enabled for e.g. a week or longer before using the results. Note
1044 that this feature is optional and must be enabled at compile-time,
1045 thus it may not be available in all pre-built packages.
1046 If protobuf is enabled and configured, then the newly observed domain
1047 status will appear as a flag in Response messages.
1048
1049 .. _setting-new-domain-log:
1050
1051 ``new-domain-log``
1052 ------------------
1053 .. versionadded:: 4.2.0
1054
1055 - Boolean
1056 - Default: yes (enabled)
1057
1058 If a newly observed domain is detected, log that domain in the
1059 recursor log file. The log line looks something like::
1060
1061 Jul 18 11:31:25 Newly observed domain nod=sdfoijdfio.com
1062
1063 .. _setting-new-domain-lookup:
1064
1065 ``new-domain-lookup``
1066 ---------------------
1067 .. versionadded:: 4.2.0
1068
1069 - Domain Name
1070 - Example: nod.powerdns.com
1071
1072 If a domain is specified, then each time a newly observed domain is
1073 detected, the recursor will perform an A record lookup of "<newly
1074 observed domain>.<lookup domain>". For example if 'new-domain-lookup'
1075 is configured as 'nod.powerdns.com', and a new domain 'xyz123.tv' is
1076 detected, then an A record lookup will be made for
1077 'xyz123.tv.nod.powerdns.com'. This feature gives a way to share the
1078 newly observed domain with partners, vendors or security teams. The
1079 result of the DNS lookup will be ignored by the recursor.
1080
1081 .. _setting-new-domain-db-size:
1082
1083 ``new-domain-db-size``
1084 ----------------------
1085 .. versionadded:: 4.2.0
1086
1087 - Integer
1088 - Example: 67108864
1089
1090 The default size of the stable bloom filter used to store previously
1091 observed domains is 67108864. To change the number of cells, use this
1092 setting. For each cell, the SBF uses 1 bit of memory, and one byte of
1093 disk for the persistent file.
1094 If there are already persistent files saved to disk, this setting will
1095 have no effect unless you remove the existing files.
1096
1097 .. _setting-new-domain-history-dir:
1098
1099 ``new-domain-history-dir``
1100 --------------------------
1101 .. versionadded:: 4.2.0
1102
1103 - Path
1104
1105 This setting controls which directory is used to store the on-disk
1106 cache of previously observed domains.
1107
1108 The default depends on ``LOCALSTATEDIR`` when building the software.
1109 Usually this comes down to ``/var/lib/pdns-recursor/nod`` or ``/usr/local/var/lib/pdns-recursor/nod``).
1110
1111 The newly observed domain feature uses a stable bloom filter to store
1112 a history of previously observed domains. The data structure is
1113 synchronized to disk every 10 minutes, and is also initialized from
1114 disk on startup. This ensures that previously observed domains are
1115 preserved across recursor restarts.
1116 If you change the new-domain-db-size setting, you must remove any files
1117 from this directory.
1118
1119 .. _setting-new-domain-whitelist:
1120
1121 ``new-domain-whitelist``
1122 ------------------------
1123 .. versionadded:: 4.2.0
1124
1125 - List of Domain Names, comma separated
1126 - Example: xyz.com, abc.com
1127
1128 This setting is a list of all domains (and implicitly all subdomains)
1129 that will never be considered a new domain. For example, if the domain
1130 'xyz123.tv' is in the list, then 'foo.bar.xyz123.tv' will never be
1131 considered a new domain. One use-case for the whitelist is to never
1132 reveal details of internal subdomains via the new-domain-lookup
1133 feature.
1134
1135 .. _setting-new-domain-pb-tag:
1136
1137 ``new-domain-pb-tag``
1138 ---------------------
1139 .. versionadded:: 4.2.0
1140
1141 - String
1142 - Default: pnds-nod
1143
1144 If protobuf is configured, then this tag will be added to all protobuf response messages when
1145 a new domain is observed.
1146
1147 .. _setting-network-timeout:
1148
1149 ``network-timeout``
1150 -------------------
1151 - Integer
1152 - Default: 1500
1153
1154 Number of milliseconds to wait for a remote authoritative server to respond.
1155
1156 .. _setting-nothing-below-nxdomain:
1157
1158 ``nothing-below-nxdomain``
1159 --------------------------
1160 .. versionadded:: 4.3.0
1161
1162 - One of ``no``, ``dnssec``, ``yes``, String
1163 - Default: ``dnssec``
1164
1165 The type of :rfc:`8020` handling using cached NXDOMAIN responses.
1166 This RFC specifies that NXDOMAIN means that the DNS tree under the denied name MUST be empty.
1167 When an NXDOMAIN exists in the cache for a shorter name than the qname, no lookup is done and an NXDOMAIN is sent to the client.
1168
1169 For instance, when ``foo.example.net`` is negatively cached, any query
1170 matching ``*.foo.example.net`` will be answered with NXDOMAIN directly
1171 without consulting authoritative servers.
1172
1173 no
1174 ^^
1175 No :rfc:`8020` processing is done.
1176
1177 dnssec
1178 ^^^^^^
1179 :rfc:`8020` processing is only done using cached NXDOMAIN records that are
1180 DNSSEC validated.
1181
1182 yes
1183 ^^^
1184 :rfc:`8020` processing is done using any non-Bogus NXDOMAIN record
1185 available in the cache.
1186
1187 .. _setting-nsec3-max-iterations:
1188
1189 ``nsec3-max-iterations``
1190 ------------------------
1191 .. versionadded:: 4.1.0
1192
1193 - Integer
1194 - Default: 2500
1195
1196 Maximum number of iterations allowed for an NSEC3 record.
1197 If an answer containing an NSEC3 record with more iterations is received, its DNSSEC validation status is treated as Insecure.
1198
1199 .. _setting-packetcache-ttl:
1200
1201 ``packetcache-ttl``
1202 -------------------
1203 - Integer
1204 - Default: 3600
1205
1206 Maximum number of seconds to cache an item in the packet cache, no matter what the original TTL specified.
1207
1208 .. _setting-packetcache-servfail-ttl:
1209
1210 ``packetcache-servfail-ttl``
1211 ----------------------------
1212 - Integer
1213 - Default: 60
1214
1215 Maximum number of seconds to cache a 'server failure' answer in the packet cache.
1216
1217 .. versionchanged:: 4.0.0
1218
1219 This setting's maximum is capped to `packetcache-ttl`_.
1220 i.e. setting ``packetcache-ttl=15`` and keeping ``packetcache-servfail-ttl`` at the default will lower ``packetcache-servfail-ttl`` to ``15``.
1221
1222 .. _setting-pdns-distributes-queries:
1223
1224 ``pdns-distributes-queries``
1225 ----------------------------
1226 - Boolean
1227 - Default: yes
1228
1229 If set, PowerDNS will have only 1 thread listening on client sockets, and distribute work by itself over threads by using a hash of the query,
1230 maximizing the cache hit ratio. Starting with version 4.2.0, more than one distributing thread can be started using the `distributor-threads`_
1231 setting.
1232 Improves performance on Linux.
1233
1234 .. _setting-protobuf-use-kernel-timestamp:
1235
1236 ``protobuf-use-kernel-timestamp``
1237 ---------------------------------
1238 .. versionadded:: 4.2.0
1239
1240 - Boolean
1241 - Default: false
1242
1243 Whether to compute the latency of responses in protobuf messages using the timestamp set by the kernel when the query packet was received (when available), instead of computing it based on the moment we start processing the query.
1244
1245 .. _setting-proxy-protocol-from:
1246
1247 ``proxy-protocol-from``
1248 -----------------------
1249 .. versionadded:: 4.4.0
1250
1251 - IP ranges, separated by commas
1252 - Default: empty
1253
1254 Ranges that are required to send a Proxy Protocol version 2 header in front of UDP and TCP queries, to pass the original source and destination addresses and ports to the recursor, as well as custom values.
1255 Queries that are not prefixed with such a header will not be accepted from clients in these ranges. Queries prefixed by headers from clients that are not listed in these ranges will be dropped.
1256
1257 Note that once a Proxy Protocol header has been received, the source address from the proxy header instead of the address of the proxy will be checked against the `allow-from`_ ACL,
1258
1259 .. _setting-proxy-protocol-maximum-size:
1260
1261 ``proxy-protocol-maximum-size``
1262 -------------------------------
1263 .. versionadded:: 4.4.0
1264
1265 - Integer
1266 - Default: 512
1267
1268 The maximum size, in bytes, of a Proxy Protocol payload (header, addresses and ports, and TLV values). Queries with a larger payload will be dropped.
1269
1270 .. _setting-public-suffix-list-file:
1271
1272 ``public-suffix-list-file``
1273 ---------------------------
1274 .. versionadded:: 4.2.0
1275
1276 - Path
1277 - Default: unset
1278
1279 Path to the Public Suffix List file, if any. If set, PowerDNS will try to load the Public Suffix List from this file instead of using the built-in list. The PSL is used to group the queries by relevant domain names when displaying the top queries.
1280
1281 .. _setting-qname-minimization:
1282
1283 ``qname-minimization``
1284 ----------------------
1285 .. versionadded:: 4.3.0
1286
1287 - Boolean
1288 - Default: yes
1289
1290 Enable Query Name Minimization. This implements a relaxed form of Query Name Mimimization as
1291 described in :rfc:`7816`.
1292
1293 .. _setting-query-local-address:
1294
1295 ``query-local-address``
1296 -----------------------
1297 - IPv4 Address, comma separated
1298 - Default: 0.0.0.0
1299
1300 Send out local queries from this address, or addresses, by adding multiple addresses, increased spoofing resilience is achieved.
1301
1302 .. _setting-query-local-address6:
1303
1304 ``query-local-address6``
1305 ------------------------
1306 - IPv6 addresses, comma separated
1307 - Default: unset
1308
1309 Send out local IPv6 queries from this address or addresses.
1310 Disabled by default, which also disables outgoing IPv6 support.
1311
1312 .. _setting-quiet:
1313
1314 ``quiet``
1315 ---------
1316 - Boolean
1317 - Default: yes
1318
1319 Don't log queries.
1320
1321 .. _setting-reuseport:
1322
1323 ``reuseport``
1324 -------------
1325 - Boolean
1326 - Default: no
1327
1328 If ``SO_REUSEPORT`` support is available, allows multiple processes to open a listening socket on the same port.
1329
1330 Since 4.1.0, when ``pdns-distributes-queries`` is set to false and ``reuseport`` is enabled, every thread will open a separate listening socket to let the kernel distribute the incoming queries, avoiding any thundering herd issue as well as the distributor thread being a bottleneck, thus leading to much higher performance on multi-core boxes.
1331
1332 .. _setting-rng:
1333
1334 ``rng``
1335 -------
1336
1337 - String
1338 - Default: auto
1339
1340 Specify which random number generator to use. Permissible choices are
1341 - auto - choose automatically
1342 - sodium - Use libsodium ``randombytes_uniform``
1343 - openssl - Use libcrypto ``RAND_bytes``
1344 - getrandom - Use libc getrandom, falls back to urandom if it does not really work
1345 - arc4random - Use BSD ``arc4random_uniform``
1346 - urandom - Use ``/dev/urandom``
1347 - kiss - Use simple settable deterministic RNG. **FOR TESTING PURPOSES ONLY!**
1348
1349 .. note::
1350 Not all choices are available on all systems.
1351
1352 .. _setting-root-nx-trust:
1353
1354 ``root-nx-trust``
1355 -----------------
1356 - Boolean
1357 - Default: yes
1358
1359 If set, an NXDOMAIN from the root-servers will serve as a blanket NXDOMAIN for the entire TLD the query belonged to.
1360 The effect of this is far fewer queries to the root-servers.
1361
1362 .. versionchanged:: 4.0.0
1363
1364 Default is 'yes' now, was 'no' before 4.0.0
1365
1366 .. _setting-security-poll-suffix:
1367
1368 ``security-poll-suffix``
1369 ------------------------
1370 - String
1371 - Default: secpoll.powerdns.com.
1372
1373 Domain name from which to query security update notifications.
1374 Setting this to an empty string disables secpoll.
1375
1376 .. _setting-serve-rfc1918:
1377
1378 ``serve-rfc1918``
1379 -----------------
1380 - Boolean
1381 - Default: yes
1382
1383 This makes the server authoritatively aware of: ``10.in-addr.arpa``, ``168.192.in-addr.arpa``, ``16-31.172.in-addr.arpa``, which saves load on the AS112 servers.
1384 Individual parts of these zones can still be loaded or forwarded.
1385
1386 .. _setting-server-down-max-fails:
1387
1388 ``server-down-max-fails``
1389 -------------------------
1390 - Integer
1391 - Default: 64
1392
1393 If a server has not responded in any way this many times in a row, no longer send it any queries for `server-down-throttle-time`_ seconds.
1394 Afterwards, we will try a new packet, and if that also gets no response at all, we again throttle for `server-down-throttle-time`_ seconds.
1395 Even a single response packet will drop the block.
1396
1397 .. _setting-server-down-throttle-time:
1398
1399 ``server-down-throttle-time``
1400 -----------------------------
1401 - Integer
1402 - Default: 60
1403
1404 Throttle a server that has failed to respond `server-down-max-fails`_ times for this many seconds.
1405
1406 .. _setting-server-id:
1407
1408 ``server-id``
1409 -------------
1410 - String
1411 - Default: The hostname of the server
1412
1413 The reply given by The PowerDNS recursor to a query for 'id.server' with its hostname, useful for in clusters.
1414 When a query contains the :rfc:`NSID EDNS0 Option <5001>`, this value is returned in the response as the NSID value.
1415
1416 This setting can be used to override the answer given to these queries.
1417 Set to "disabled" to disable NSID and 'id.server' answers.
1418
1419 Query example (where 192.0.2.14 is your server):
1420
1421 .. code-block:: sh
1422
1423 dig @192.0.2.14 CHAOS TXT id.server.
1424 dig @192.0.2.14 example.com IN A +nsid
1425
1426 ``setgid``, ``setuid``
1427 ----------------------
1428 - String
1429 - Default: unset
1430
1431 PowerDNS can change its user and group id after binding to its socket.
1432 Can be used for better :doc:`security <security>`.
1433
1434 .. _setting-signature-inception-skew:
1435
1436 ``signature-inception-skew``
1437 ----------------------------------
1438 .. versionadded:: 4.1.5
1439
1440 - Integer
1441 - Default: 60
1442
1443 Allow the signature inception to be off by this number of seconds. Negative values are not allowed.
1444
1445 .. versionchanged:: 4.2.0
1446
1447 Default is now 60, was 0 before.
1448
1449 .. _setting-single-socket:
1450
1451 ``single-socket``
1452 -----------------
1453 - Boolean
1454 - Default: no
1455
1456 Use only a single socket for outgoing queries.
1457
1458 .. _setting-snmp-agent:
1459
1460 ``snmp-agent``
1461 --------------
1462 .. versionadded:: 4.1.0
1463
1464 - Boolean
1465 - Default: no
1466
1467 If set to true and PowerDNS has been compiled with SNMP support, it will register as an SNMP agent to provide statistics and be able to send traps.
1468
1469 .. _setting-snmp-master-socket:
1470
1471 ``snmp-master-socket``
1472 ----------------------
1473 .. versionadded:: 4.1.0
1474
1475 - String
1476 - Default: empty
1477
1478 If not empty and ``snmp-agent`` is set to true, indicates how PowerDNS should contact the SNMP master to register as an SNMP agent.
1479
1480 .. _setting-socket-dir:
1481
1482 ``socket-dir``
1483 --------------
1484 - Path
1485
1486 Where to store the control socket and pidfile.
1487 The default depends on ``LOCALSTATEDIR`` or the ``--with-socketdir`` setting when building (usually ``/var/run`` or ``/run``).
1488
1489 When using `chroot`_ the default becomes to ``/``.
1490
1491 ``socket-owner``, ``socket-group``, ``socket-mode``
1492 ---------------------------------------------------
1493 Owner, group and mode of the controlsocket.
1494 Owner and group can be specified by name, mode is in octal.
1495
1496 .. _setting-spoof-nearmiss-max:
1497
1498 ``spoof-nearmiss-max``
1499 ----------------------
1500 - Integer
1501 - Default: 20
1502
1503 If set to non-zero, PowerDNS will assume it is being spoofed after seeing this many answers with the wrong id.
1504
1505 .. _setting-stack-size:
1506
1507 ``stack-size``
1508 --------------
1509 - Integer
1510 - Default: 200000
1511
1512 Size of the stack per thread.
1513
1514 .. _setting-statistics-interval:
1515
1516 ``statistics-interval``
1517 -----------------------
1518 .. versionadded:: 4.1.0
1519
1520 - Integer
1521 - Default: 1800
1522
1523 Interval between logging statistical summary on recursor performance.
1524 Use 0 to disable.
1525
1526 .. _setting-stats-api-blacklist:
1527
1528 ``stats-api-blacklist``
1529 -----------------------
1530 .. versionadded:: 4.2.0
1531
1532 - String
1533 - Default: "cache-bytes, packetcache-bytes, special-memory-usage, ecs-v4-response-bits-*, ecs-v6-response-bits-*"
1534
1535 A list of comma-separated statistic names, that are disabled when retrieving the complete list of statistics via the API for performance reasons.
1536 These statistics can still be retrieved individually by specifically asking for it.
1537
1538 .. _setting-stats-carbon-blacklist:
1539
1540 ``stats-carbon-blacklist``
1541 --------------------------
1542 .. versionadded:: 4.2.0
1543
1544 - String
1545 - Default: "cache-bytes, packetcache-bytes, special-memory-usage, ecs-v4-response-bits-*, ecs-v6-response-bits-*"
1546
1547 A list of comma-separated statistic names, that are prevented from being exported via carbon for performance reasons.
1548
1549 .. _setting-stats-rec-control-blacklist:
1550
1551 ``stats-rec-control-blacklist``
1552 -------------------------------
1553 .. versionadded:: 4.2.0
1554
1555 - String
1556 - Default: "cache-bytes, packetcache-bytes, special-memory-usage, ecs-v4-response-bits-*, ecs-v6-response-bits-*"
1557
1558 A list of comma-separated statistic names, that are disabled when retrieving the complete list of statistics via `rec_control get-all`, for performance reasons.
1559 These statistics can still be retrieved individually.
1560
1561 .. _setting-stats-ringbuffer-entries:
1562
1563 ``stats-ringbuffer-entries``
1564 ----------------------------
1565 - Integer
1566 - Default: 10000
1567
1568 Number of entries in the remotes ringbuffer, which keeps statistics on who is querying your server.
1569 Can be read out using ``rec_control top-remotes``.
1570
1571 .. _setting-stats-snmp-blacklist:
1572
1573 ``stats-snmp-blacklist``
1574 ------------------------
1575 .. versionadded:: 4.2.0
1576
1577 - String
1578 - Default: "cache-bytes, packetcache-bytes, special-memory-usage, ecs-v4-response-bits-*, ecs-v6-response-bits-*"
1579
1580 A list of comma-separated statistic names, that are prevented from being exported via SNMP, for performance reasons.
1581
1582 .. _setting-tcp-fast-open:
1583
1584 ``tcp-fast-open``
1585 -----------------
1586 .. versionadded:: 4.1.0
1587
1588 - Integer
1589 - Default: 0 (Disabled)
1590
1591 Enable TCP Fast Open support, if available, on the listening sockets.
1592 The numerical value supplied is used as the queue size, 0 meaning disabled.
1593
1594 .. _setting-threads:
1595
1596 ``threads``
1597 -----------
1598 - Integer
1599 - Default: 2
1600
1601 Spawn this number of threads on startup.
1602
1603 .. _setting-trace:
1604
1605 ``trace``
1606 ---------
1607 - Boolean
1608 - Default: no
1609
1610 If turned on, output impressive heaps of logging.
1611 May destroy performance under load.
1612
1613 .. _setting-udp-source-port-min:
1614
1615 ``udp-source-port-min``
1616 -----------------------
1617 .. versionadded:: 4.2.0
1618
1619 - Integer
1620 - Default: 1024
1621
1622 This option sets the low limit of UDP port number to bind on.
1623
1624 In combination with `udp-source-port-max`_ it configures the UDP
1625 port range to use. Port numbers are randomized within this range on
1626 initialization, and exceptions can be configured with `udp-source-port-avoid`_
1627
1628 .. _setting-udp-source-port-max:
1629
1630 ``udp-source-port-max``
1631 -----------------------
1632 .. versionadded:: 4.2.0
1633
1634 - Integer
1635 - Default: 65535
1636
1637 This option sets the maximum limit of UDP port number to bind on.
1638
1639 See `udp-source-port-min`_.
1640
1641 .. _setting-udp-source-port-avoid:
1642
1643 ``udp-source-port-avoid``
1644 -------------------------
1645 .. versionadded:: 4.2.0
1646
1647 - String
1648 - Default: 11211
1649
1650 A list of comma-separated UDP port numbers to avoid when binding.
1651 Ex: `5300,11211`
1652
1653 See `udp-source-port-min`_.
1654
1655 .. _setting-udp-truncation-threshold:
1656
1657 ``udp-truncation-threshold``
1658 ----------------------------
1659 .. versionchanged:: 4.2.0
1660 Before 4.2.0, the default was 1680
1661
1662 - Integer
1663 - Default: 1232
1664
1665 EDNS0 allows for large UDP response datagrams, which can potentially raise performance.
1666 Large responses however also have downsides in terms of reflection attacks.
1667 This setting limits the accepted size.
1668 Maximum value is 65535, but values above 4096 should probably not be attempted.
1669
1670 To know why 1232, see the note at :ref:`setting-edns-outgoing-bufsize`.
1671
1672 .. _setting-unique-response-tracking:
1673
1674 ``unique-response-tracking``
1675 ----------------------------
1676 .. versionadded:: 4.2.0
1677
1678 - Boolean
1679 - Default: no (disabled)
1680
1681 Whether to track unique DNS responses, i.e. never seen before combinations
1682 of the triplet (query name, query type, RR[rrname, rrtype, rrdata]).
1683 This can be useful for tracking potentially suspicious domains and
1684 behaviour, e.g. DNS fast-flux.
1685 If protobuf is enabled and configured, then the Protobuf Response message
1686 will contain a flag with udr set to true for each RR that is considered
1687 unique, i.e. never seen before.
1688 This feature uses a probabilistic data structure (stable bloom filter) to
1689 track unique responses, which can have false positives as well as false
1690 negatives, thus it is a best-effort feature. Increasing the number of cells
1691 in the SBF using the unique-response-db-size setting can reduce FPs and FNs.
1692
1693 .. _setting-unique-response-log:
1694
1695 ``unique-response-log``
1696 -----------------------
1697 .. versionadded:: 4.2.0
1698
1699 - Boolean
1700 - Default: no (disabled)
1701
1702 Whether to log when a unique response is detected. The log line
1703 looks something like:
1704
1705 Oct 24 12:11:27 Unique response observed: qname=foo.com qtype=A rrtype=AAAA rrname=foo.com rrcontent=1.2.3.4
1706
1707 .. _setting-unique-response-db-size:
1708
1709 ``unique-response-db-size``
1710 ---------------------------
1711 .. versionadded:: 4.2.0
1712
1713 - Integer
1714 - Example: 67108864
1715
1716 The default size of the stable bloom filter used to store previously
1717 observed responses is 67108864. To change the number of cells, use this
1718 setting. For each cell, the SBF uses 1 bit of memory, and one byte of
1719 disk for the persistent file.
1720 If there are already persistent files saved to disk, this setting will
1721 have no effect unless you remove the existing files.
1722
1723 .. _setting-unique-response-history-dir:
1724
1725 ``unique-response-history-dir``
1726 -------------------------------
1727 .. versionadded:: 4.2.0
1728
1729 - Path
1730
1731 This setting controls which directory is used to store the on-disk
1732 cache of previously observed responses.
1733
1734 The default depends on ``LOCALSTATEDIR`` when building the software.
1735 Usually this comes down to ``/var/lib/pdns-recursor/udr`` or ``/usr/local/var/lib/pdns-recursor/udr``).
1736
1737 The newly observed domain feature uses a stable bloom filter to store
1738 a history of previously observed responses. The data structure is
1739 synchronized to disk every 10 minutes, and is also initialized from
1740 disk on startup. This ensures that previously observed responses are
1741 preserved across recursor restarts. If you change the
1742 unique-response-db-size, you must remove any files from this directory.
1743
1744 .. _setting-unique-response-pb-tag:
1745
1746 ``unique-response-pb-tag``
1747 --------------------------
1748 .. versionadded:: 4.2.0
1749
1750 - String
1751 - Default: pnds-udr
1752
1753 If protobuf is configured, then this tag will be added to all protobuf response messages when
1754 a unique DNS response is observed.
1755
1756 .. _setting-use-incoming-edns-subnet:
1757
1758 ``use-incoming-edns-subnet``
1759 ----------------------------
1760 - Boolean
1761 - Default: no
1762
1763 Whether to process and pass along a received EDNS Client Subnet to authoritative servers.
1764 The ECS information will only be sent for netmasks and domains listed in `edns-subnet-whitelist`_ and will be truncated if the received scope exceeds `ecs-ipv4-bits`_ for IPv4 or `ecs-ipv6-bits`_ for IPv6.
1765
1766 .. _setting-version:
1767
1768 ``version``
1769 -----------
1770 Print version of this binary. Useful for checking which version of the PowerDNS recursor is installed on a system.
1771
1772 .. _setting-version-string:
1773
1774 ``version-string``
1775 ------------------
1776 - String
1777 - Default: PowerDNS Recursor version number
1778
1779 By default, PowerDNS replies to the 'version.bind' query with its version number.
1780 Security conscious users may wish to override the reply PowerDNS issues.
1781
1782 .. _setting-webserver:
1783
1784 ``webserver``
1785 -------------
1786 - Boolean
1787 - Default: no
1788
1789 Start the webserver (for REST API).
1790
1791 .. _setting-webserver-address:
1792
1793 ``webserver-address``
1794 ---------------------
1795 - IP Address
1796 - Default: 127.0.0.1
1797
1798 IP address for the webserver to listen on.
1799
1800 .. _setting-webserver-allow-from:
1801
1802 ``webserver-allow-from``
1803 ------------------------
1804 - IP addresses, comma separated
1805 - Default: 127.0.0.1,::1
1806
1807 .. versionchanged:: 4.1.0
1808
1809 Default is now 127.0.0.1,::1, was 0.0.0.0,::/0 before.
1810
1811 These subnets are allowed to access the webserver.
1812
1813 .. _setting-webserver-loglevel:
1814
1815 ``webserver-loglevel``
1816 ----------------------
1817 .. versionadded:: 4.2.0
1818
1819 - String, one of "none", "normal", "detailed"
1820
1821 The amount of logging the webserver must do. "none" means no useful webserver information will be logged.
1822 When set to "normal", the webserver will log a line per request that should be familiar::
1823
1824 [webserver] e235780e-a5cf-415e-9326-9d33383e739e 127.0.0.1:55376 "GET /api/v1/servers/localhost/bla HTTP/1.1" 404 196
1825
1826 When set to "detailed", all information about the request and response are logged::
1827
1828 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Request Details:
1829 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Headers:
1830 [webserver] e235780e-a5cf-415e-9326-9d33383e739e accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
1831 [webserver] e235780e-a5cf-415e-9326-9d33383e739e accept-encoding: gzip, deflate
1832 [webserver] e235780e-a5cf-415e-9326-9d33383e739e accept-language: en-US,en;q=0.5
1833 [webserver] e235780e-a5cf-415e-9326-9d33383e739e connection: keep-alive
1834 [webserver] e235780e-a5cf-415e-9326-9d33383e739e dnt: 1
1835 [webserver] e235780e-a5cf-415e-9326-9d33383e739e host: 127.0.0.1:8081
1836 [webserver] e235780e-a5cf-415e-9326-9d33383e739e upgrade-insecure-requests: 1
1837 [webserver] e235780e-a5cf-415e-9326-9d33383e739e user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
1838 [webserver] e235780e-a5cf-415e-9326-9d33383e739e No body
1839 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Response details:
1840 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Headers:
1841 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Connection: close
1842 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Content-Length: 49
1843 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Content-Type: text/html; charset=utf-8
1844 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Server: PowerDNS/0.0.15896.0.gaba8bab3ab
1845 [webserver] e235780e-a5cf-415e-9326-9d33383e739e Full body:
1846 [webserver] e235780e-a5cf-415e-9326-9d33383e739e <!html><title>Not Found</title><h1>Not Found</h1>
1847 [webserver] e235780e-a5cf-415e-9326-9d33383e739e 127.0.0.1:55376 "GET /api/v1/servers/localhost/bla HTTP/1.1" 404 196
1848
1849 The value between the hooks is a UUID that is generated for each request. This can be used to find all lines related to a single request.
1850
1851 .. note::
1852 The webserver logs these line on the NOTICE level. The :ref:`settings-loglevel` seting must be 5 or higher for these lines to end up in the log.
1853
1854 .. _setting-webserver-password:
1855
1856 ``webserver-password``
1857 ----------------------
1858 - String
1859 - Default: unset
1860
1861 Password required to access the webserver.
1862
1863 .. _setting-webserver-port:
1864
1865 ``webserver-port``
1866 ------------------
1867 - Integer
1868 - Default: 8082
1869
1870 TCP port where the webserver should listen on.
1871
1872 .. _setting-write-pid:
1873
1874 ``write-pid``
1875 -------------
1876 - Boolean
1877 - Default: yes
1878
1879 If a PID file should be written to `socket-dir`_
1880
1881 .. _setting-xpf-allow-from:
1882
1883 ``xpf-allow-from``
1884 ------------------
1885 .. versionadded:: 4.2.0
1886
1887 - IP ranges, separated by commas
1888 - Default: empty
1889
1890 .. note::
1891 This is an experimental implementation of `draft-bellis-dnsop-xpf <https://datatracker.ietf.org/doc/draft-bellis-dnsop-xpf/>`_.
1892
1893 The server will trust XPF records found in queries sent from those netmasks (both IPv4 and IPv6),
1894 and will adjust queries' source and destination accordingly. This is especially useful when the recursor
1895 is placed behind a proxy like `dnsdist <https://dnsdist.org>`_.
1896 Note that the :ref:`setting-allow-from` setting is still applied to the original source address, and thus access restriction
1897 should be done on the proxy.
1898
1899 .. _setting-xpf-rr-code:
1900
1901 ``xpf-rr-code``
1902 ---------------
1903 .. versionadded:: 4.2.0
1904
1905 - Integer
1906 - Default: 0
1907
1908 .. note::
1909 This is an experimental implementation of `draft-bellis-dnsop-xpf <https://datatracker.ietf.org/doc/draft-bellis-dnsop-xpf/>`_.
1910
1911 This option sets the resource record code to use for XPF records, as long as an official code has not been assigned to it.
1912 0 means that XPF is disabled.