]> git.ipfire.org Git - thirdparty/pdns.git/blame - docs/dnssec/modes-of-operation.rst
Add new Authoritative Server documentation.
[thirdparty/pdns.git] / docs / dnssec / modes-of-operation.rst
CommitLineData
0e2063c3
PL
1DNSSEC Modes of Operation
2=========================
3
4Traditionally, DNSSEC signatures have been added to unsigned zones, and
5then this signed zone could be served by any DNSSEC capable
6authoritative server. PowerDNS supports this mode fully.
7
8In addition, PowerDNS supports taking care of the signing itself, in
9which case PowerDNS operates differently from most tutorials and
10handbooks. This mode is easier however.
11
12For relevant tradeoffs, please see :doc:`../security` and
13:doc:`../performance`.
14
15.. _dnssec-online-signing:
16
17Online Signing
18--------------
19
20In the simplest situation, there is a single "SQL" database that
21contains, in separate tables, all domain data, keying material and other
22DNSSEC related settings.
23
24This database is then replicated to all PowerDNS instances, which all
25serve identical records, keys and signatures.
26
27In this mode of operation, care should be taken that the database
28replication occurs over a secure network, or over an encrypted
29connection. This is because keying material, if intercepted, could be
30used to counterfeit DNSSEC data using the original keys.
31
32Such a single replicated database requires no further attention beyond
33monitoring already required during non-DNSSEC operations.
34
35Records, Keys, signatures, hashes within PowerDNS in online signing mode
36~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37
38Within PowerDNS live signing, keys are stored separately from the zone
39records. Zone data are only combined with signatures and keys when
40requests come in over the internet.
41
42Each zone can have a number of keys associated with it, with varying key
43lengths. Typically 1 or at most 2 of these keys are employed as actual
44Zone Signing Keys (ZSKs). During normal operations, this means that only
451 ZSK is 'active', and the other is inactive.
46
47Should it be desired to 'roll over' to a new key, both keys can
48temporarily be active (and used for signing), and after a while the old
49key can be inactivated. Subsequently it can be removed.
50
51As elucidated above, there are several ways in which DNSSEC can deny the
52existence of a record, and this setting too is stored away from zone
53records, and lives with the DNSSEC keying material.
54
55(Hashed) Denial of Existence
56~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57
58PowerDNS supports unhashed secure denial of existence using NSEC
59records. These are generated with the help of the (database) backend,
60which needs to be able to supply the 'previous' and 'next' records in
61canonical ordering.
62
63The Generic SQL Backends have fields that allow them to supply these
64relative record names.
65
66In addition, hashed secure denial of existence is supported using NSEC3
67records, in two modes, one with help from the database, the other with
68the help of some additional calculations.
69
70NSEC3 in 'broad' or 'inclusive' mode works with the aid of the backend,
71where the backend should be able to supply the previous and next domain
72names in hashed order.
73
74NSEC3 in 'narrow' mode uses additional hashing calculations to provide
75hashed secure denial of existence 'on the fly', without further
76involving the database.
77
78.. _dnssec-signatures:
79
80Signatures
81~~~~~~~~~~
82
83In PowerDNS live signing mode, signatures, as served through RRSIG
84records, are calculated on the fly, and heavily cached. All CPU cores
85are used for the calculation.
86
87RRSIGs have a validity period, in PowerDNS by default this period starts
88at most a week in the past, and continues at least a week into the
89future.
90
91Precisely speaking, the time period used is always from the start of the
92previous Thursday until the Thursday two weeks later. This two-week
93interval jumps with one-week increments every Thursday.
94
95.. note::
96 Why Thursday? POSIX-based operating systems count the time
97 since GMT midnight January 1st of 1970, which was a Thursday. PowerDNS
98 inception/expiration times are generated based on an integral number of
99 weeks having passed since the start of the 'epoch'.
100
101PowerDNS also serves the DNSKEY records in live-signing mode. Their TTL
102is derived from the SOA records *minimum* field. When using NSEC3, the
103TTL of the NSEC3PARAM record is also derived from that field.
104
105Pre-signed records
106------------------
107
108In this mode, PowerDNS serves zones that already contain DNSSEC records.
109Such zones can either be slaved from a remote master, or can be signed
110using tools like OpenDNSSEC, ldns-signzone or dnssec-signzone.
111
112Even in this mode, PowerDNS will synthesize NSEC(3) records itself
113because of its architecture. RRSIGs of these NSEC(3) will still need to
114be imported. See the :ref:`Presigned migration guide <dnssec-migration-presigned>`.
115
116Front-signing
117-------------
118
119As a special feature, PowerDNS can operate as a signing server which
120operates as a slave to an unsigned master.
121
122In this way, if keying material is available for an unsigned zone that
123is retrieved from a master server, this keying material will be used
124when serving data from this zone.
125
126As part of the zone retrieval, the equivalent of
127``pdnsutil rectify-zone`` is run to make sure that all DNSSEC-related
128fields are set correctly in the backend.
129
130Signed AXFR
131-----------
132
133An outgoing zone transfer from a signing master contains all information
134required for the receiving party to rectify the zone without knowing the
135keys, such as signed NSEC3 records for empty non-terminals. The zone is
136not required to be rectified on the master.
137
138Signatures and Hashing is similar as described in :ref:`dnssec-online-signing`.
139
140BIND-mode operation
141-------------------
142
143The :doc:`bindbackend <../backends/bind>` can manage keys in an
144SQLite3 database without launching a separate gsqlite3 backend.
145
146To use this mode, add
147``bind-dnssec-db=/var/db/bind-dnssec-db.sqlite3`` to pdns.conf, and run
148``pdnsutil create-bind-db /var/db/bind-dnssec-db.sqlite3``. Then,
149restart PowerDNS.
150
151After this, you can use ``pdnsutil secure-zone`` and all other pdnsutil
152commands on your BIND zones without trouble.
153
154.. _dnssec-modes-hybrid-bind:
155
156Hybrid BIND-mode operation
157--------------------------
158
159PowerDNS can also operate based on 'BIND'-style zone & configuration
160files. This 'bindbackend' has full knowledge of DNSSEC, but has no
161native way of storing keying material.
162
163However, since PowerDNS supports operation with multiple simultaneous
164backends, this is not a problem.
165
166In hybrid mode, keying material and zone records are stored in different
167backends. This allows for 'bindbackend' operation in full DNSSEC mode.
168
169To benefit from this mode, include at least one database-based backend
170in the 'launch' statement. The :doc:`SQLite 3 backend <../backends/generic-sqlite3>` probably complements BIND mode
171best, since it does not require a database server process.
172
173.. warning::
174 For now, it is necessary to execute a manual SQL 'insert'
175 into the domains table of the backend hosting the keying material. This
176 is needed to generate a zone-id for the relevant domain. Sample SQL
177 statement::
178
179 insert into domains (name, type) values ('powerdnssec.org', 'NATIVE');