summaryrefslogtreecommitdiff
path: root/samples/knot.full.conf
blob: 49edf13aa3cbeeca02e214e89f155e442cad2d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
#
# knot.sample.conf
#
# This is a sample configuration file for Knot DNS server.
#

# This is a comment.

#
# There are 7 main sections of this config file:
#   system, interfaces, remotes, groups, zones, control and log
#

# Section 'system' contains general options for the server
system {

  # Identity of the server (see RFC 4892).
  identity "I have no mouth and must scream";

  # Version of the server (see RFC 4892).
  version "1.3";

  # Host name of the server (see RFC 4892).
  hostname "myserver0.ns.example.com";

  # Server identifier
  # Use string format "text"
  # Or hexstring 0x01ab00
  nsid "myserver0";

  # This is a default directory to place slave zone files, journals etc.
  # default: ${localstatedir}/lib/knot, configured with --with-storage
  storage "/var/lib/knot";

  # Directory for storing run-time data
  # e.g. PID file and control sockets
  # default: ${localstatedir}/run/knot, configured with --with-rundir
  rundir "/var/run/knot";

  # Number of workers per interface
  # This option is used to force number of threads used per interface
  # Default: unset (auto-estimates optimal value from the number of online CPUs)
  # workers 3;

  # User for running server
  # May also specify user.group (e.g. knot.users)
  # user knot.users;

  # Maximum idle time between requests on a TCP connection
  # It is also possible to suffix with unit size [s/m/h/d]
  # f.e. 1s = 1 second, 1m = 1 minute, 1h = 1 hour, 1d = 1 day
  # Default: 60s
  max-conn-idle 60s;

  # Maximum time between newly accepted TCP connection and first query
  # This is useful to disconnect inactive connections faster
  # It is also possible to suffix with unit size [s/m/h/d]
  # f.e. 1s = 1 second, 1m = 1 minute, 1h = 1 hour, 1d = 1 day
  # Default: 10s
  max-conn-handshake 10s;

  # Maximum time to wait for a reply to SOA query
  # It is also possible to suffix with unit size [s/m/h/d]
  # f.e. 1s = 1 second, 1m = 1 minute, 1h = 1 hour, 1d = 1 day
  # Default: 10s
  max-conn-reply 10s;

  # Number of parallel transfers
  # This number also includes pending SOA queries
  # Minimal value is number of CPUs
  # Default: 10
  transfers 10;

  # Rate limit
  # in queries / second
  # Default: off (=0)
  rate-limit 0;

  # Rate limit bucket size
  # Number of hashtable buckets, set to reasonable value as default.
  # We chose a reasonably large prime number as it's used for hashtable size,
  # it is recommended to do so as well due to better distribution.
  # Rule of thumb is to set it to about 1.2 * (maximum_qps)
  # Memory cost is approx. 32B per bucket
  # Default: 393241
  rate-limit-size 393241;

  # Rate limit SLIP
  # Each Nth blocked response will be sent as truncated, this is a way to allow
  # legitimate requests to get a chance to reconnect using TCP
  # Default: 2
  rate-limit-slip 2;
}

# Includes can be placed anywhere at any level in the configuration file. The
# file name can be relative to current file or absolute.
#
# This include includes keys which are commented out in next section.
include "knot.keys.conf";

# Section 'keys' contains list of TSIG keys
#keys {
#
#  # TSIG key
#  #
#  # format: name key-type "<key>";
#  # where key-type may be one of the following:
#  #   hmac-md5
#  #   hmac-sha1
#  #   hmac-sha224
#  #   hmac-sha256
#  #   hmac-sha384
#  #   hmac-sha512
#  # and <key> is the private key
#  key0.server0 hmac-md5 "Wg==";
#
#  # TSIG key for zone
#  key0.example.com hmac-md5 "==gW";
#}

# Section 'interfaces' contains definitions of listening interfaces.
interfaces {

  # Interface entry
  #
  # Format 1: <name> { address <address>; [port <port>;] }
  ipv4 {                # <name> is an arbitrary symbolic name
    address 127.0.0.1;  # <address> may be ither IPv4 or IPv6 address
    port 53531;         # port is required for XFR/IN and NOTIFY/OUT
  }

  # Format 2: <name> { address <address>@<port>; }
  # shortipv4 {
  #   address 127.0.0.1@53532;
  #}

  # Format 1 (IPv6 interface)
  # ipv6 {
  #   address ::1@53533;
  # }

  # Format 2 (IPv6 interface)
  # ipv6b {
  #   address [::1]@53534;
  # }

}

# Section 'remotes' contains symbolic names for remote servers.
# Syntax for 'remotes' is the same as for 'interfaces'.
remotes {

  # Remote entry
  #
  # Format 1: <name> { address <address>; [port <port>;] }
  server0 {             # <name> is an arbitrary symbolic name
    address 127.0.0.1;  # <address> may be ither IPv4 or IPv6 address
    port 53531;         # port is optional (default: 53)
    key key0.server0;   # (optional) specification of TSIG key associated for this remote
    via ipv4;           # (optional) source interface for queries
    via 82.35.64.59;    # (optional) source interface for queries, direct IPv4
    via [::cafe];       # (optional) source interface for queries, direct IPv6
  }

  # Format 2: <name> { address <address>@<port>; }
  server1 {
    address 127.0.0.1@53001;
  }

  admin-alice {
    address 192.168.100.1;
  }

  admin-bob {
    address 192.168.100.2;
  }
}

groups {
  admins { admin-alice, admin-bob }
}

# Section 'control' specifies on which interface to listen for RC commands
control {

  # Specifies interface, syntax is exactly the same as in 'interfaces' section
  # Default: $(run_dir)/knot.sock
  listen-on "knot.sock";

  # As an alternative, you can use an IPv4/v6 address and port
  # listen-on { address 127.0.0.1@5533; }

  # Specifies ACL list for remote control
  # Same syntax as for ACLs in zones
  # List of remotes or groups delimited by comma
  # Notice: keep in mind that ACLs bear no effect with UNIX sockets
  # allow server0, admins;
}

# Section 'zones' contains information about zones to be served.
zones {

  # Shared options for all listed zones
  #

  # Build differences from zone file changes. EXPERIMENTAL feature.
  # Possible values: on|off
  # Default value: off
  ixfr-from-differences off;

  # Enable semantic checks for all zones (if 'on')
  # Possible values: on|off
  # Default value: off
  semantic-checks off;

  # Disable ANY type queries for authoritative answers (if 'on')
  # Possible values: on|off
  # Default value: off
  disable-any off;

  # NOTIFY response timeout
  # Possible values: <1,...> (seconds)
  # Default value: 60
  notify-timeout 60;

  # Number of retries for NOTIFY
  # Possible values: <1,...>
  # Default value: 5
  notify-retries 5;

  # Timeout for syncing changes from zone database to zonefile
  # Possible values: <1..INT_MAX> (seconds)
  # Default value: 1h (1 hour)
  # It is also possible to suffix with unit size [s/m/h/d]
  # f.e. 1s = 1 day, 1m = 1 minute, 1h = 1 hour, 1d = 1 day
  zonefile-sync 1h;

  # File size limit for IXFR journal
  # Possible values: <1..INT_MAX>
  # Default value: N/A (infinite)
  # It is also possible to suffix with unit size [k/M/G]
  # f.e. 1k, 100M, 2G
  ixfr-fslimit 1G;

  # Zone entry
  #
  # Format: <zone-name> { file "<path-to-zone-file>"; }
  example.com {  # <zone-name> is the DNS name of the zone (zone root)
    # <path-to-zone-file> may be either absolute or relative, in which case
    #   it is considered relative to the current directory from which the server
    #   was started.
    file "samples/example.com.zone";

    # Build differences from zone file changes
    # Possible values: on|off
    # Default value: off
    ixfr-from-differences off;

    # Disable ANY type queries for authoritative answers (if 'on')
    # Possible values: on|off
    # Default value: off
    disable-any off;

    # Enable zone semantic checks
    # Possible values: on|off
    # Default value: off
    semantic-checks on;

    # NOTIFY response timeout (specific for current zone)
    # Possible values: <1,...> (seconds)
    # Default value: 60
    notify-timeout 60;

    # Number of retries for NOTIFY (specific for current zone)
    # Possible values: <1,...>
    # Default value: 5
    notify-retries 5;

    # Timeout for syncing changes from zone database to zonefile
    # Possible values: <1..INT_MAX> (seconds)
    # Default value: inherited from zones.zonefile-sync
    # It is also possible to suffix with unit size [s/m/h/d]
    # f.e. 1s = 1 second, 1m = 1 minute, 1h = 1 hour, 1d = 1 day
    zonefile-sync 1h;

    # XFR master server
    xfr-in server0;

    # ACL list of XFR slaves
    xfr-out server0, server1;

    # ACL list of servers allowed to send NOTIFY queries
    notify-in server0;

    # List of servers to send NOTIFY to
    notify-out server0, server1;

    # List of servers to allow UPDATE queries
    update-in server0, admins;
  }
}

# Section 'log' configures logging of server messages.
#
# Logging recognizes 3 symbolic names of log devices:
#   stdout    - Standard output
#   stderr    - Standard error output
#   syslog    - Syslog
#
# In addition, arbitrary number of log files may be specified (see below).
#
# Log messages are characterized by severity and category.
# Supported severities:
#   debug     - Debug messages. Must be turned on at compile time.
#   info      - Informational messages.
#   notice    - Notices and hints.
#   warning   - Warnings. An action from the operator may be required.
#   error     - Recoverable error. Some action should be taken.
#   fatal     - Non-recoverable errors resulting in server shutdown.
#               (Not supported yet.)
#   all       - All severities.
#
# Categories designate the source of the log message and roughly correspond
#   to server modules
# Supported categories:
#   server    - Messages related to general operation of the server.
#   zone      - Messages related to zones, zone parsing and loading.
#   answering - Messages regarding query processing and response creation.
#   any       - All categories
#
# More severities (separated by commas) may be listed for each category.
# All applicable severities must be listed.
#   (I.e. specifying 'error' severity does mean: 'log error messages',
#    and NOT 'log all messages of severity error and above'.)
#
# Default settings (in case there are no entries in 'log' section or the section
# is missing at all):
#
# stderr { any error; }
# syslog { any error; }
log {

  # Log entry
  #
  # Format 1:
  # <log> {
  #   <category1> <severity1> [, <severity2> ...];
  #   <category2> <severity1> [, <severity2> ...];
  #   ...
  # }
  syslog {     # <log> is a symbolic name of a log device (see above)
    # log errors of any category
    any error;    # for <category> and <severity> see above
    # log also warnings and notices from category 'zone'
    zone warning, notice;
    # log info from server
    server info;
  }

  # Log fatal, warnings and errors to stderr
  stderr {
    any error, warning;
  }

  # Format 2:
  # file <path> {
  #   <category1> <severity1> [, <severity2> ...];
  #   <category2> <severity1> [, <severity2> ...];
  # }
  file "/tmp/knot-sample/knotd.debug" {  # <path> is absolute or relative path to log file
    server debug;
  }
}