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