1# 2# nsd.conf -- the NSD(8) configuration file, nsd.conf(5). 3# 4# Copyright (c) 2001-2011, NLnet Labs. All rights reserved. 5# 6# See LICENSE for the license. 7# 8 9# This is a comment. 10# Sample configuration file 11# include: "file" # include that file's text over here. Globbed, "*.conf" 12 13# options for the nsd server 14server: 15 # Number of NSD servers to fork. Put the number of CPUs to use here. 16 # server-count: 1 17 18 # Set overall CPU affinity for NSD processes on Linux and FreeBSD. 19 # Any server/xfrd CPU affinity value will be masked by this value. 20 # cpu-affinity: 0 1 2 3 21 22 # Bind NSD server(s), configured by server-count (1-based), to a 23 # dedicated core. Single core affinity improves L1/L2 cache hits and 24 # reduces pipeline stalls/flushes. 25 # 26 # server-1-cpu-affinity: 0 27 # server-2-cpu-affinity: 1 28 # ... 29 # server-<N>-cpu-affinity: 2 30 31 # Bind xfrd to a dedicated core. 32 # xfrd-cpu-affinity: 3 33 34 # Specify specific interfaces to bind (default are the wildcard 35 # interfaces 0.0.0.0 and ::0). 36 # For servers with multiple IP addresses, list them one by one, 37 # or the source address of replies could be wrong. 38 # Use ip-transparent to be able to list addresses that turn on later. 39 # ip-address: 1.2.3.4 40 # ip-address: 1.2.3.4@5678 41 # ip-address: 12fe::8ef0 42 # 43 # IP addresses can be configured per-server to avoid waking up more 44 # than one server when a packet comes in (thundering herd problem) or 45 # to partition sockets across servers to improve select/poll 46 # performance. 47 # 48 # ip-address: 1.2.3.4 servers="1-2 3" 49 # ip-address: 1.2.3.4@5678 servers="4-5 6" 50 # 51 # When several interfaces are configured to listen on the same subnet, 52 # care must be taken to ensure responses go out the same interface the 53 # corresponding query came in on to avoid problems with load balancers 54 # and VLAN tagged interfaces. Linux offers the SO_BINDTODEVICE socket 55 # option to bind a socket to a specified device. For FreeBSD, to 56 # achieve the same result, specify the routing table to use after the 57 # IP address to use SO_SETFIB. 58 # 59 # Complement with socket partitioning and CPU affinity for attack 60 # mitigation benefits. i.e. only a single core is maxed out if a 61 # specific IP address is under attack. 62 # 63 # ip-address: 1.2.3.4 setfib=0 bindtodevice=yes 64 # ip-address: 1.2.3.5@6789 setfib=1 bindtodevice=yes 65 66 # Allow binding to non local addresses. Default no. 67 # ip-transparent: no 68 69 # Allow binding to addresses that are down. Default no. 70 # ip-freebind: no 71 72 # Use SO_REUSEPORT socket option for performance. Default no. 73 # reuseport: no 74 75 # override maximum socket send buffer size. Default of 0 results in 76 # send buffer size being set to 1048576 (bytes). 77 # send-buffer-size: 1048576 78 79 # override maximum socket receive buffer size. Default of 0 results in 80 # receive buffer size being set to 1048576 (bytes). 81 # receive-buffer-size: 1048576 82 83 # enable debug mode, does not fork daemon process into the background. 84 # debug-mode: no 85 86 # listen on IPv4 connections 87 # do-ip4: yes 88 89 # listen on IPv6 connections 90 # do-ip6: yes 91 92 # port to answer queries on. default is 53. 93 # port: 53 94 95 # Verbosity level. 96 # verbosity: 0 97 98 # After binding socket, drop user privileges. 99 # can be a username, id or id.gid. 100 # username: @user@ 101 102 # Run NSD in a chroot-jail. 103 # make sure to have pidfile reachable from there. 104 # by default, no chroot-jail is used. 105 # chroot: "@configdir@" 106 107 # The directory for zonefile: files. The daemon chdirs here. 108 # zonesdir: "@zonesdir@" 109 110 # the list of dynamically added zones. 111 # zonelistfile: "@zonelistfile@" 112 113 # log messages to file. Default to stderr and syslog (with 114 # facility LOG_DAEMON). stderr disappears when daemon goes to bg. 115 # logfile: "@logfile@" 116 117 # log only to syslog. 118 # log-only-syslog: no 119 120 # File to store pid for nsd in. 121 # pidfile: "@pidfile@" 122 123 # The file where secondary zone refresh and expire timeouts are kept. 124 # If you delete this file, all secondary zones are forced to be 125 # 'refreshing' (as if nsd got a notify). Set to "" to disable. 126 # xfrdfile: "@xfrdfile@" 127 128 # The directory where zone transfers are stored, in a subdir of it. 129 # xfrdir: "@xfrdir@" 130 131 # don't answer VERSION.BIND and VERSION.SERVER CHAOS class queries 132 # hide-version: no 133 134 # don't answer HOSTNAME.BIND and ID.SERVER CHAOS class queries 135 # hide-identity: no 136 137 # Drop UPDATE queries 138 # drop-updates: no 139 140 # version string the server responds with for chaos queries. 141 # default is 'NSD x.y.z' with the server's version number. 142 # version: "NSD" 143 144 # identify the server (CH TXT ID.SERVER entry). 145 # identity: "unidentified server" 146 147 # NSID identity (hex string, or "ascii_somestring"). default disabled. 148 # nsid: "aabbccdd" 149 150 # Maximum number of concurrent TCP connections per server. 151 # tcp-count: 100 152 153 # Accept (and immediately close) TCP connections after maximum number 154 # of connections is reached to prevent kernel connection queue from 155 # growing. 156 # tcp-reject-overflow: no 157 158 # Maximum number of queries served on a single TCP connection. 159 # By default 0, which means no maximum. 160 # tcp-query-count: 0 161 162 # Override the default (120 seconds) TCP timeout. 163 # tcp-timeout: 120 164 165 # Maximum segment size (MSS) of TCP socket on which the server 166 # responds to queries. Default is 0, system default MSS. 167 # tcp-mss: 0 168 169 # Maximum segment size (MSS) of TCP socket for outgoing AXFR request. 170 # Default is 0, system default MSS. 171 # outgoing-tcp-mss: 0 172 173 # reduce these settings to save memory for NSD, to about 174 # xfrd-tcp-max: 32 and xfrd-tcp-pipeline: 128, also rrl-size: 1000 175 # other memory is determined by server-count, tcp-count and zone data 176 # max number of sockets used for outgoing zone transfers. 177 # Increase this to allow more sockets for zone transfers. 178 # xfrd-tcp-max: 128 179 # max number of simultaneous outgoing zone transfers over one socket. 180 # xfrd-tcp-pipeline: 128 181 182 # Preferred EDNS buffer size for IPv4. 183 # ipv4-edns-size: 1232 184 185 # Preferred EDNS buffer size for IPv6. 186 # ipv6-edns-size: 1232 187 188 # statistics are produced every number of seconds. Prints to log. 189 # Default is 0, meaning no statistics are produced. 190 # statistics: 3600 191 192 # Number of seconds between reloads triggered by xfrd. 193 # xfrd-reload-timeout: 1 194 195 # log timestamp in ascii (y-m-d h:m:s.msec), yes is default. 196 # log-time-ascii: yes 197 198 # round robin rotation of records in the answer. 199 # round-robin: no 200 201 # minimal-responses only emits extra data for referrals. 202 # minimal-responses: no 203 204 # Do not return additional information if the apex zone of the 205 # additional information is configured but does not match the apex zone 206 # of the initial query. 207 # confine-to-zone: no 208 209 # refuse queries of type ANY. For stopping floods. 210 # refuse-any: no 211 212 # check mtime of all zone files on start and sighup 213 # zonefiles-check: yes 214 215 # write changed zonefiles to disk, every N seconds. 216 # default is 3600. 217 # zonefiles-write: 3600 218 219 # RRLconfig 220 # Response Rate Limiting, size of the hashtable. Default 1000000. 221 # rrl-size: 1000000 222 223 # Response Rate Limiting, maximum QPS allowed (from one query source). 224 # If set to 0, ratelimiting is disabled. Also set 225 # rrl-whitelist-ratelimit to 0 to disable ratelimit processing. 226 # Default is @ratelimit_default@. 227 # rrl-ratelimit: 200 228 229 # Response Rate Limiting, number of packets to discard before 230 # sending a SLIP response (a truncated one, allowing an honest 231 # resolver to retry with TCP). Default is 2 (one half of the 232 # queries will receive a SLIP response, 0 disables SLIP (all 233 # packets are discarded), 1 means every request will get a 234 # SLIP response. When the ratelimit is hit the traffic is 235 # divided by the rrl-slip value. 236 # rrl-slip: 2 237 238 # Response Rate Limiting, IPv4 prefix length. Addresses are 239 # grouped by netblock. 240 # rrl-ipv4-prefix-length: 24 241 242 # Response Rate Limiting, IPv6 prefix length. Addresses are 243 # grouped by netblock. 244 # rrl-ipv6-prefix-length: 64 245 246 # Response Rate Limiting, maximum QPS allowed (from one query source) 247 # for whitelisted types. Default is @ratelimit_default@. 248 # rrl-whitelist-ratelimit: 2000 249 # RRLend 250 251 # Service clients over TLS (on the TCP sockets), with plain DNS inside 252 # the TLS stream. Give the certificate to use and private key. 253 # Default is "" (disabled). Requires restart to take effect. 254 # tls-service-key: "path/to/privatekeyfile.key" 255 # tls-service-pem: "path/to/publiccertfile.pem" 256 # tls-service-ocsp: "path/to/ocsp.pem" 257 # tls-port: 853 258 259 # Certificates used to authenticate connections made upstream for 260 # Transfers over TLS (XoT). Default is "" (default verify locations). 261 # tls-cert-bundle: "path/to/ca-bundle.pem" 262 263 # The interfaces that use these listed port numbers will support and 264 # expect PROXYv2. For UDP and TCP/TLS interfaces. 265 # proxy-protocol-port: portno for each of the port numbers. 266 267verify: 268 # Enable zone verification. Default is no. 269 # enable: no 270 271 # Port to answer verifier queries on. Default is 5347. 272 # port: 5347 273 274 # Interfaces to bind for zone verification (default are the localhost 275 # interfaces, usually 127.0.0.1 and ::1). To bind to to multiple IP 276 # addresses, list them one by one. Socket options cannot be specified 277 # for verify ip-address options. 278 # ip-address: 127.0.0.1 279 # ip-address: 127.0.0.1@5347 280 # ip-address: ::1 281 282 # Verify zones by default. Default is yes. 283 # verify-zones: yes 284 285 # Command to execute for zone verification. 286 # verifier: ldns-verify-zone 287 # verifier: validns - 288 # verifier: drill -k <keyfile> @127.0.0.1 -p 5347 example.com SOA 289 290 # Maximum number of verifiers to run concurrently. Default is 1. 291 # verifier-count: 1 292 293 # Feed updated zone to verifier over standard input. Default is yes. 294 # verifier-feed-zone: yes 295 296 # Number of seconds before verifier is killed (0 is forever). 297 # verifier-timeout: 0 298 299# DNSTAP config section, if compiled with that 300# dnstap: 301 # set this to yes and set one or more of dnstap-log-..-messages to yes. 302 # dnstap-enable: no 303 # dnstap-socket-path: "@dnstap_socket_path@" 304 # for dnstap-ip, "" is disabled, use TCP or TLS with like 127.0.0.1@3333 305 # dnstap-ip: "" 306 # dnstap-tls: yes 307 # dnstap-tls-server-name: "" 308 # dnstap-tls-cert-bundle: "path/to/bundle.pem" 309 # dnstap-tls-client-key-file: "" 310 # dnstap-tls-client-cert-file: "" 311 # dnstap-send-identity: no 312 # dnstap-send-version: no 313 # dnstap-identity: "" 314 # dnstap-version: "" 315 # dnstap-log-auth-query-messages: no 316 # dnstap-log-auth-response-messages: no 317 318# Remote control config section. 319remote-control: 320 # Enable remote control with nsd-control(8) here. 321 # set up the keys and certificates with nsd-control-setup. 322 # control-enable: no 323 324 # what interfaces are listened to for control, default is on localhost. 325 # interfaces can be specified by IP address or interface name. 326 # with an interface name, all IP addresses associated with that 327 # interface are used. 328 # with an absolute path, a unix local named pipe is used for control 329 # (and key and cert files are not needed, use directory permissions). 330 # control-interface: 127.0.0.1 331 # control-interface: ::1 332 # control-interface: lo 333 334 # port number for remote control operations (uses TLS over TCP). 335 # control-port: 8952 336 337 # nsd server key file for remote control. 338 # server-key-file: "@configdir@/nsd_server.key" 339 340 # nsd server certificate file for remote control. 341 # server-cert-file: "@configdir@/nsd_server.pem" 342 343 # nsd-control key file. 344 # control-key-file: "@configdir@/nsd_control.key" 345 346 # nsd-control certificate file. 347 # control-cert-file: "@configdir@/nsd_control.pem" 348 349 350# Secret keys for TSIGs that secure zone transfers. 351# You could include: "secret.keys" and put the 'key:' statements in there, 352# and give that file special access control permissions. 353# 354# key: 355 # The key name is sent to the other party, it must be the same 356 #name: "keyname" 357 # algorithm hmac-md5, or sha1, sha256, sha224, sha384, sha512 358 #algorithm: sha256 359 # secret material, must be the same as the other party uses. 360 # base64 encoded random number. 361 # e.g. from dd if=/dev/random of=/dev/stdout count=1 bs=32 | base64 362 #secret: "K2tf3TRjvQkVCmJF3/Z9vA==" 363 364# The tls-auth clause establishes authentication attributes to use when 365# authenticating the far end of an outgoing TLS connection in access control 366# lists used for XFR-over-TLS. If authentication fails, the XFR request will not 367# be made. Support for TLS 1.3 is required for XFR-over-TLS. It has the 368# following attributes: 369# 370# tls-auth: 371 # The tls-auth name. Used to refer to this TLS auth information in the access control list. 372 #name: "tls-authname" 373 # The authentication domain name as defined in RFC8310. 374 #auth-domain-name: "example.com" 375 376 # Client certificate and private key for Mutual TLS authentication 377 #client-cert: "path/to/clientcert.pem" 378 #client-key: "path/to/clientkey.key" 379 #client-key-pw: "password" 380 381# Patterns have zone configuration and they are shared by one or more zones. 382# 383# pattern: 384 # name by which the pattern is referred to 385 #name: "myzones" 386 # the zonefile for the zones that use this pattern. 387 # if relative then from the zonesdir (inside the chroot). 388 # the name is processed: %s - zone name (as appears in zone:name). 389 # %1 - first character of zone name, %2 second, %3 third. 390 # %z - topleveldomain label of zone, %y, %x next labels in name. 391 # if label or character does not exist you get a dot '.'. 392 # for example "%s.zone" or "zones/%1/%2/%3/%s" or "secondary/%z/%s" 393 #zonefile: "%s.zone" 394 395 # The allow-query allows an access control list to be specified 396 # for a zone to be queried. Without an allow-query option, any 397 # IP address is allowed to send queries for the zone. 398 # This could be useful for example to not leak content from a zone 399 # which is only offered for transfer to secondaries over TLS. 400 #allow-query: 192.0.2.0/24 NOKEY 401 402 # If no primary and secondary access control elements are provided, 403 # this zone will not be served to/from other servers. 404 405 # A primary zone needs notify: and provide-xfr: lists. A secondary 406 # may also allow zone transfer (for debug or other secondaries). 407 # notify these secondaries when the primary zone changes, address TSIG|NOKEY 408 # IP can be ipv4 and ipv6, with @port for a nondefault port number. 409 #notify: 192.0.2.1 NOKEY 410 # allow these IPs and TSIG to transfer zones, addr TSIG|NOKEY|BLOCKED 411 # address range 192.0.2.0/24, 1.2.3.4&255.255.0.0, 3.0.2.20-3.0.2.40 412 #provide-xfr: 192.0.2.0/24 my_tsig_key_name 413 # set the number of retries for notify. 414 #notify-retry: 5 415 # if yes, store and provide IXFRs. 416 #store-ixfr: no 417 # number of IXFR versions to store, at most. 418 #ixfr-number: 5 419 # size in bytes of max storage to use for IXFR versions. 420 #ixfr-size: 1048576 421 # if yes, create IXFR when a zonefile is read by the server. 422 #create-ixfr: no 423 424 # uncomment to provide AXFR to all the world 425 # provide-xfr: 0.0.0.0/0 NOKEY 426 # provide-xfr: ::0/0 NOKEY 427 428 # A secondary zone needs allow-notify: and request-xfr: lists. 429 #allow-notify: 2001:db8::0/64 my_tsig_key_name 430 # By default, a secondary will request a zone transfer with IXFR/TCP. 431 # If you want to make use of IXFR/UDP use: UDP addr tsigkey 432 # for a master that only speaks AXFR (like NSD) use AXFR addr tsigkey 433 # If you want to require use of XFR-over-TLS use: addr tsigkey tlsauthname 434 #request-xfr: 192.0.2.2 the_tsig_key_name 435 #request-xfr: 192.0.2.2 the_tsig_key_name the_tls_auth_name 436 # Attention: You cannot use UDP and AXFR together. AXFR is always over 437 # TCP. If you use UDP, we highly recommend you to deploy TSIG. 438 # Allow AXFR fallback if the master does not support IXFR. Default 439 # is yes. 440 #allow-axfr-fallback: yes 441 # set local interface for sending zone transfer requests. 442 # default is let the OS choose. 443 #outgoing-interface: 10.0.0.10 444 # limit the refresh and retry interval in seconds. 445 #max-refresh-time: 2419200 446 #min-refresh-time: 0 447 #max-retry-time: 1209600 448 #min-retry-time: 0 449 # Lower bound of expire interval in seconds. The value can be "refresh+retry+1" 450 # in which case the lower bound of expire interval is the sum of the refresh and 451 # retry values (limited to the bounds given with the above parameters), plus 1. 452 #min-expire-time: 0 453 454 # Secondary server tries zone transfer to all primaries and picks highest 455 # zone version available, for when primaries have different versions. 456 #multi-primary-check: no 457 458 # limit the zone transfer size (in bytes), stops very large transfers 459 # 0 is no limits enforced. 460 # size-limit-xfr: 0 461 462 # if compiled with --enable-zone-stats, give name of stat block for 463 # this zone (or group of zones). Output from nsd-control stats. 464 # zonestats: "%s" 465 466 # if you give another pattern name here, at this point the settings 467 # from that pattern are inserted into this one (as if it were a 468 # macro). The statement can be given in between other statements, 469 # because the order of access control elements can make a difference 470 # (which master to request from first, which secondary to notify first). 471 #include-pattern: "common-masters" 472 473 # Verify zone before publishing. 474 # Default is value of verify-zones in verify. 475 # verify-zone: yes 476 477 # Command to execute for zone verification. 478 # Default is verifier in verify. 479 # verifier: ldns-verify-zone 480 # verifier: validns - 481 # verifier: drill -k <keyfile> @127.0.0.1 -p 5347 example.com SOA 482 483 # Feed updated zone to verifier over standard input. 484 # Default is value of verifier-feed-zone in verify. 485 # verifier-feed-zone: yes 486 487 # Number of seconds before verifier is killed (0 is forever). 488 # Default is verifier-timeout in verify. 489 # verifier-timeout: 0 490 491 # Turn this zone into a catalog consumer zone. 492 # The catalog-member-pattern option is the default pattern that 493 # will be used for members without or with invalid group property. 494 # catalog: consumer 495 # catalog-member-pattern: "example-pattern" 496 497 # Turn this zone into a catalog producer zone. 498 # Member zones can be added using nsd-control addzone <zone> <pattern> 499 # where <pattern> is a pattern containing a catalog-producer-zone 500 # option pointing to this zone. 501 # catalog: producer 502 503 # Use this pattern to add catalog producer members. "catalog1.invalid" 504 # needs to be a valid catalog producer zone; i.e. a primary zone 505 # without a request-xfr option and with and catalog option set to 506 # producer. 507 # catalog-producer-member: "catalog1.invalid" 508 509# Fixed zone entries. Here you can config zones that cannot be deleted. 510# Zones that are dynamically added and deleted are put in the zonelist file. 511# 512# zone: 513 # name: "example.com" 514 # you can give a pattern here, all the settings from that pattern 515 # are then inserted at this point 516 # include-pattern: "master" 517 # You can also specify (additional) options directly for this zone. 518 # zonefile: "example.com.zone" 519 # request-xfr: 192.0.2.1 example.com.key 520 521 # RRLconfig 522 # Response Rate Limiting, whitelist types 523 # rrl-whitelist: nxdomain 524 # rrl-whitelist: error 525 # rrl-whitelist: referral 526 # rrl-whitelist: any 527 # rrl-whitelist: rrsig 528 # rrl-whitelist: wildcard 529 # rrl-whitelist: nodata 530 # rrl-whitelist: dnskey 531 # rrl-whitelist: positive 532 # rrl-whitelist: all 533 # RRLend 534 535