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