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