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