Home | History | Annotate | Line # | Download | only in doc
      1 1.0 Introduction
      2 1.1 ... Basic theory of operation
      3 1.2 ... Quick build & install
      4 2.0 Building nsd
      5 2.1 ... Unpacking the source
      6 2.2 ... Configuring NSD
      7 2.3 ... Building
      8 2.4 ... Installing
      9 3.0 Running NSD
     10 3.1 ... Logging
     11 3.2 ... AXFR access
     12 3.3 ... Using TSIG
     13 3.4 ... Zone expiry of secondary zones
     14 3.5 ... Diagnosing NSD log entries
     15 3.6 ... Interfaces
     16 3.7 ... Tuning
     17 3.8 ... Zone verification
     18 4.0 Support and Feedback
     19 4.1 ... Your Support
     20 
     21 
     22 1.0 Introduction
     23 
     24 This is NSD Name Server Daemon (NSD) version 4.14.0.
     25 
     26 The NLnet Labs Name Server Daemon (NSD) is an authoritative RFC compliant 
     27 DNS nameserver. It was first conceived to allow for more genetic 
     28 diversity for DNS server implementations used by the root-server system 
     29 and it has been developed for operations in environments where speed, 
     30 reliability, stability, and security are of high importance. NSD is 
     31 currently used on root servers such as k.root-servers.net and is also in 
     32 use by several top-level domain registries.
     33 
     34 NSD is a complete implementation of an authoritative DNS name server.
     35 For further information about what NSD is and what NSD is not please
     36 consult the REQUIREMENTS document which is a part of this distribution.
     37 
     38 If you are a BIND user (the named daemon) consult NSD_FOR_BIND_USERS.
     39 
     40 The source code is available for download from:
     41 
     42          http://www.nlnetlabs.nl/downloads
     43 
     44 
     45 1.1 Basic Theory of Operation
     46 
     47 NSD consists of two programs: the zone compiler 'zonec' and the name
     48 server 'nsd' itself. The name server works with an intermediate
     49 database prepared by the zone compiler from standard zone files.
     50 
     51 For NSD operation this means that zones have to be compiled by zonec
     52 before NSD can use them.
     53 
     54 All this can be controlled via rc.d (SIGTERM, SIGHUP) or nsd-control,
     55 and uses a simple configuration file 'nsd.conf'.
     56 
     57 
     58 1.2 Quick build and install
     59 
     60 Step 1: Unpack the source with gtar -xzvf nsd-4.14.0.tar.gz
     61 
     62 Step 2: Create user nsd or any other unprivileged user of your
     63         choice. In case of later make sure to use
     64         --with-user=<username> while running configure.
     65 	You can also set "username: <name>" in the nsd.conf file later.
     66 	Install openssl and libevent.
     67 
     68 Step 3: ./configure
     69 
     70 Step 4: make all	(or simply 'make').
     71 
     72 Step 5: make install
     73 
     74 Step 6: Create and edit /etc/nsd/nsd.conf file possibly from
     75         nsd.conf.sample template that comes with the distribution.
     76 	(installed by default at /etc/nsd/nsd.conf.sample)
     77 	Here you need to configure the zones you want to serve.
     78 	TSIG keys used for secure zone transfers must be included.
     79 	Also server parameters can be set, see nsd.conf(5) man page.
     80 
     81 	If you have a NSD 2 nsd.zones config file take a look at the
     82 	python script contrib/nsd.zones2nsd.conf, it will convert 
     83 	zone and TSIG key settings for you.
     84 
     85 Step 7: Copy necessary master zone files into appropriate directories
     86         under /etc/nsd/primary & /etc/nsd/secondary. 
     87 
     88 Step 8: Run nsd-control start
     89 
     90 Step 9: Test the NSD with dig, drill or host.
     91 
     92 Step 10: If you're happy add a rc.d script to start into your OS boot up
     93 	 sequence. The format of the rc.d startup script depends on 
     94 	 the platform.  Also stop it in the shutdown sequence.
     95 	 You can use SIGTERM to stop, or nsd-control stop.
     96 
     97 Step 11: If desired add 'nsd-control write' to your superuser crontab to
     98          update the zone files with the content transferred from master
     99 	 servers periodically, such as once per day.
    100 
    101          Got any problems or questions with the steps above? Read the
    102          rest of this file.
    103 
    104 
    105 
    106 2.0 Building NSD
    107 
    108 
    109 2.1 Unpacking the source
    110 
    111 Use your favorite combination of tar and gnu zip to unpack the source,
    112 for example
    113 
    114 $ gtar -xzvf nsd-4.14.0.tar.gz
    115 
    116 will unpack the source into the ./nsd-4.14.0 directory...
    117 
    118 
    119 2.2 Configuring NSD
    120 
    121 NSD can be configured using GNU autoconf's configure script. In
    122 addition to standard configure options, one may use the following:
    123 
    124   CC=compiler
    125  
    126         Specify the C compiler.  The default is gcc or cc.  The
    127         compiler must support ANSI C89.
    128 
    129   CPPFLAGS=flags
    130 
    131         Specify the C preprocessor flags.  Such as -I<includedir>.
    132 
    133   CFLAGS=flags
    134 
    135         Specify the C compiler flags.  These include code generation,
    136         optimization, warning, and debugging flags.  These flags are
    137         also passed to the linker.
    138 
    139         The default for gcc is "-g -O2".
    140 
    141   LD=linker
    142 
    143         Specify the linker (defaults to the C compiler).
    144 
    145   LDFLAGS=flags
    146 
    147         Specify linker flags.
    148 
    149   LIBS=libs
    150  
    151         Specify additional libraries to link with.
    152 
    153   --disable-ipv6
    154 
    155         Disables IPv6 support in NSD.
    156 
    157   --enable-checking
    158 
    159         Enable some internal development checks.  Useful if you want
    160         to modify NSD.  This option enables the standard C "assert" macro
    161 	and compiler warnings.
    162 
    163 	This will instruct NSD to be stricter when validating its input. 
    164 	This could lead to a reduced service level.
    165 
    166   --disable-bind8-stats
    167 
    168         Disable BIND8-like statistics.
    169 
    170   --disable-zone-stats
    171 
    172 	Disable per-zone statistics gathering (if enabled, it needs
    173 	bind8-stats).
    174 
    175   --disable-ratelimit
    176 
    177 	Disables ratelimiting, based on query name, type and source.
    178 
    179   --disable-ratelimit-default-is-off
    180 
    181 	Disable this to set default of ratelimit to on (this controls
    182 	the default, ratelimits can be enabled and disabled in nsd.conf).
    183 
    184   --disable-dnstap
    185 
    186 	Disable dnstap support (requires fstrm-devel, protobuf-c).
    187 
    188   --enable-systemd
    189 
    190 	Compile with systemd support, and then the server notifies libsystemd
    191 	when the server is up (it needs pkg-config and systemd-devel).
    192 
    193   --with-configdir=dir
    194 
    195         Specified, NSD configuration directory, default /etc/nsd
    196 
    197   --with-nsd_conf_file=path
    198 
    199 	Pathname to the NSD configuration file, default /etc/nsd/nsd.conf
    200 
    201   --with-pidfile=path
    202 
    203         Pathname to the NSD pidfile, default is platform specific,
    204         mostly /var/run/nsd.pid
    205 
    206   --with-zonesdir=dir
    207 
    208         NSD default location for master zone files, default /etc/nsd/
    209 
    210   --with-user=username
    211 
    212         User name or ID to answer the queries with, default is nsd
    213 
    214   --with-facility=facility
    215 
    216         Specify the syslog facility to use.  The default is
    217         LOG_DAEMON.  See the syslog(3) manual page for the available
    218         facilities.
    219 
    220   --with-libevent=path
    221 
    222   	Specity the location of the libevent library (or libev).
    223 	--with-libevent=no uses a builtin portable implementation (select()).
    224 
    225   --with-ssl=path
    226 
    227         Specify the location of the OpenSSL libraries.  OpenSSL 0.9.7
    228         or higher is required for TSIG support.
    229 
    230   --with-start_priority=number
    231 
    232 	Startup priority for NSD. 
    233 
    234   --with-kill_priority=number
    235 
    236 	Shutdown priority for NSD. 
    237 
    238   --with-tcp-timeout=number
    239 
    240 	Set the default TCP timeout (in seconds). Default 120 seconds.
    241 
    242   --disable-nsec3
    243 
    244   	Disable NSEC3 support. With NSEC3 support enabled, very large zones,
    245 	also non-nsec3 zones, use about 20% more memory.
    246 
    247   --disable-minimal-responses
    248 
    249   	Disable minimal responses. If disabled, responses are more likely
    250 	to get truncated, resulting in TCP fallback.  When enabled (by default)
    251 	NSD will leave out RRsets to make responses fit inside one datagram,
    252 	but for shorter responses the full normal response is carried.
    253 
    254   --disable-largefile
    255 
    256 	Disable large file support (64 bit file lengths). Makes off_t
    257 	a 32bit length during compilation.
    258 
    259 
    260 2.3 Building
    261 
    262 Use ``make'' to create NSD and support tools.  If you get errors, try to
    263 use ``gmake'' (gnu version of make), especially on old systems. If so,
    264 do a `gmake realclean` first, to remove stuff that the make call messed up.
    265 
    266 
    267 2.4 Installing
    268 
    269 Become a superuser (if necessary) and type ``make install''
    270 
    271 This step should install four binaries
    272 
    273 nsd               - the daemon itself
    274 nsd-control-setup - a shell script that creates keys for nsd-control.
    275 nsd-control	      - program that connects over SSL to nsd and gives commands.
    276 nsd-checkconf	  - simple C program to check nsd.conf before use.
    277 
    278 Plus the manual pages and a sample configuration file.
    279 
    280 
    281 3.0 Running NSD
    282 
    283 Before running NSD you need to create a configuration file for it.
    284 The config file contains server settings, secret keys and zone settings.
    285 
    286 The server settings start with a line with the keyword 'server:'.
    287 In the server settings set 'database: <file>' with the filename of the name 
    288 database that NSD will use. Set 'chroot: <dir>' to run nsd in a chroot-jail.
    289 Make sure the zone files, database file, xfrdfile, difffile and pidfile
    290 can be accessed from the chroot-jail.  Set 'username: <user>' to an 
    291 unprivileged user, for security.  
    292 
    293 For example:
    294 	# This is a sample configuration
    295 	server:
    296 		database: "/etc/nsd/nsd.db"
    297 		pidfile: "/etc/nsd/nsd.pid"
    298 		chroot: "/etc/nsd/"
    299 		username: nsd
    300 
    301 After the global server settings to need to make entries for the
    302 zones that you wish to serve. For each zone you need to list the zone
    303 name, the file name with the zone contents, and access control lists.
    304 
    305 	zone:
    306 		name:	"example.com"
    307 		zonefile: "example.com.zone"
    308 
    309 The zonefile needs to be filled with the correct zone information
    310 for master zones. For secondary zones an empty file will suffice,
    311 a zone transfer will be initiated to obtain the slave zone contents.
    312 
    313 Access control lists are needed for zone transfer and notifications.
    314 
    315 For a slave zone list the masters, by IP address. Below is an example
    316 of a slave zone with two master servers. If a master only supports AXFR
    317 transfers and not IXFR transfers (like NSD), specify the master as
    318 "request-xfr: AXFR <ip_address> <key>". By default, all zone transfer requests 
    319 are made over TCP. If you want the IXFR request be transmitted over UDP, use
    320 "request-xfr: UDP <ip address> <key>".
    321 
    322 	zone:
    323 		name: "example.com"
    324 		zonefile: "example.com.zone"
    325 		allow-notify: 168.192.185.33 NOKEY
    326 		request-xfr: 168.192.185.33 NOKEY
    327 		allow-notify: 168.192.199.2 NOKEY
    328 		request-xfr: 168.192.199.2 NOKEY
    329 
    330 By default, a slave will fallback to AXFR requests if the master told us it does 
    331 not support IXFR. You can configure the slave not to do AXFR fallback with:
    332 
    333 		allow-axfr-fallback: "no"
    334 
    335 For a master zone, list the slave servers, by IP address or subnet.
    336 Below is an example of a master zone with two slave servers.
    337 
    338 	zone:
    339 		name: "example.com"
    340 		zonefile: "example.com.zone"
    341 		notify: 168.192.133.75 NOKEY
    342 		provide-xfr: 168.192.133.75 NOKEY
    343 		notify: 168.192.5.44 NOKEY
    344 		provide-xfr: 168.192.5.44 NOKEY
    345 
    346 You also can set the outgoing interface for notifies and zone transfer requests 
    347 to satisfy access control lists at the other end:
    348 
    349 		outgoing-interface: 168.192.5.69
    350 
    351 By default, NSD will retry a notify up to 5 times. You can override that
    352 value with: 
    353 
    354 		notify-retry: 5
    355 
    356 Zone transfers can be secured with TSIG keys, replace NOKEY with
    357 the name of the tsig key to use. See section 3.3.
    358 
    359 Since NSD is written to be run on the root name servers, the config file 
    360 can to contain something like:
    361 
    362 	zone:
    363 		name: "."
    364 		zonefile: "root.zone"
    365 		provide-xfr: 0.0.0.0/0 NOKEY # allow axfr for everyone.
    366 		provide-xfr: ::0/0 NOKEY
    367 
    368 You should only do that if you're intending to run a root server, NSD
    369 is not suited for running a . cache. Therefore if you choose to serve
    370 the .  zone you have to make sure that the complete root zone is
    371 timely and fully updated.
    372 
    373 In the config file, you can use patterns.  A pattern can have the
    374 same configuration statements that a zone can have.  And then you can
    375 include-pattern: <name-of-pattern> in a zone (or in another pattern)
    376 to apply those settings.  This can be used to organise the settings.
    377 
    378 The nsd-control tool is also controlled from the nsd.conf config file.
    379 It uses SSL encrypted transport to 127.0.0.1, and if you want to use it
    380 you have to setup the keys and also edit the config file.  You can leave
    381 the remote-control disabled (the secure default), or opt to turn it on:
    382 
    383 	# generate keys
    384 	nsd-control-setup
    385 
    386 	# edit nsd.conf to add this
    387 	remote-control:
    388 		control-enable: yes
    389 
    390 By default nsd-control is limited to localhost, as well as encrypted, but
    391 some people may want to remotely administer their nameserver.  What you
    392 then do is setup nsd-control to listen to the public IP address, with
    393 control-interface: <IP> after the control-enable statement.  Furthermore,
    394 you copy the key files /etc/nsd/nsd_server.pem /etc/nsd/nsd_control.*
    395 to a remote host on the internet; on that host you can run nsd-control
    396 with -c <special config file> which references same IP address
    397 control-interface and references the copies of the key files with
    398 server-cert-file, control-key-file and control-cert-file config lines
    399 after the control-enable statement.  The nsd-server authenticates the
    400 nsd-control client, and also the nsd-control client authenticates the
    401 nsd-server.
    402 
    403 When you are done with the configuration file, check the syntax using
    404 
    405 	nsd-checkconf <name of configfile>
    406 
    407 The zone files are read by the daemon, which builds 'nsd.db' with their
    408 contents.  You can start the daemon with
    409 
    410 	nsd
    411 	or with "nsd-control start" (which execs nsd again).
    412 	or with nsd -c <name of configfile>
    413 
    414 To check if the daemon is running look with ps, top, or if you enabled
    415 nsd-control,
    416 
    417 	nsd-control status
    418 
    419 To reload changed zone files after you edited them, without stopping
    420 the daemon, use this to check if files are modified: 
    421 
    422 	kill -HUP `cat <name of nsd pidfile>`
    423 
    424 If you enabled nsd-control, you can reread with
    425 
    426 	nsd-control reload
    427 
    428 With nsd-control you can also reread the config file (new zones, ..)
    429 
    430 	nsd-control reconfig
    431 
    432 To restart the daemon
    433 
    434 	/etc/rc.d/nsd restart  # or your system(d) equivalent
    435 
    436 To shut it down (for example on the system shutdown) do
    437 
    438 	kill -TERM <pid of nsd>
    439 	or nsd-control stop
    440 
    441 NSD will automatically keep track of secondary zones and update them
    442 when needed. When primary zones are updated and reloaded notifications
    443 are sent to slave servers.
    444 
    445 The zone transfers are applied to nsd.db by the daemon.  To write changed
    446 contents of the zone files for slave zones to disk in the text-based zone
    447 file format, issue nsd-control write.
    448 
    449 NSD will send notifications to slave zones if a master zone is updated.
    450 NSD will check for updates at master servers periodically and transfer
    451 the updated zone by AXFR/IXFR and reload the new zone contents. If
    452 you wish exert manual control use nsd-control notify, transfer and
    453 force_transfer commands.  The transfer command will check for new versions
    454 of the secondary zones hosted by this NSD. The notify command will send
    455 notifications to the slave servers configured in 'notify:' statements.
    456 
    457 
    458 3.1 Logging
    459 
    460 NSD doesn't do any logging. We believe that logging is a separate task
    461 and has to be done independently from the core operation.
    462 
    463 This consciously is not part of nsd itself in order to keep nsd
    464 focused and minimize its complexity. It is better to leave logging and
    465 tracing to separate dedicated tools. dnsstat can also easily be
    466 configured and/or modified to suit local statistics requirements
    467 without any danger of affecting the name server itself. We have run
    468 dnsstat on the same machine as nsd, we would recommend using a
    469 multiprocessor if performance is an issue. Of course it can also run
    470 on a separate machine that has MAC layer access to the network of the
    471 server.
    472 
    473 The nsd-control tool can output some statistics, with nsd-control stats
    474 and nsd-control stats_noreset.  In contrib/nsd_munin_ there is a munin
    475 grapher plugin that uses it.  The output of nsd-control stats is easy
    476 to read (text only) with scripts.  The output values are documented on
    477 the nsd-control man page.
    478 
    479 The CAIDA dnsstat tool referenced is recommended to nsd operators as a 
    480 means of keeping statistics and check on abnormal query loads.
    481 
    482     http://www.caida.org/tools/utilities/dnsstat/dnsstat-3.5.1a.tar.gz
    483 
    484 Another tool is the dnstop, that displays DNS statistics on your network.
    485 
    486     http://dns.measurement-factory.com/tools/dnstop/src/dnstop-20060517.tar.gz
    487 
    488 A sample invocation of dnsstat:
    489 
    490 /usr/local/Coral/bin/crl_dnsstat -D -Ci=60 -Cd=240 -C'filter dst 10.1.1.3'  -h -u if:fxp1
    491 
    492 A sample output of a slightly modified version:
    493 
    494 # dnsstat output version: 0.2 "dfk"
    495 
    496 # begin trace interval at 1025267664.859043, duration 15.000000
    497 # DNS messages: 74973 (4998.200000/s); DNS queries: 151983 (10132.200000/s)
    498 # print threshold: 30 messages/sec
    499 
    500 #src              op type  class queries    msgs      rd notes
    501  208.18.162.10     - -     -         533     533       0
    502  "                 0 MX    IN          6
    503  "                 0 A     IN        264
    504  "                 0 ANY   IN        263
    505  209.11.18.248     - -     -         661     661       0
    506  "                 0 A     IN        655
    507  "                 0 MX    IN          6
    508  210.117.65.137    - -     -         745     745       0
    509  "                 0 A     IN        745
    510  216.54.221.131    - -     -         477     477       0
    511  "                 0 A     IN        477
    512  193.97.205.80     - -     -         681     681       0
    513  "                 0 A     IN          3
    514  "                 0 ANY   IN        678
    515  168.30.240.11     - -     -         685     685       0
    516  "                 0 A     IN        405
    517  "                 0 MX    IN        280
    518  210.94.6.67       - -     -         742     742       0
    519  "                 0 A     IN        742
    520  63.66.68.237      - -     -        1375    1375       0
    521  "                 0 A     IN       1375
    522  168.30.240.12     - -     -         493     493       0
    523  "                 0 A     IN        493
    524  139.142.205.225   - -     -        5579    5579       0
    525  "                 0 A     IN       3006
    526  "                 0 MX    IN       2573
    527  210.117.65.2      - -     -         700     700       0
    528  "                 0 A     IN        700
    529 # end trace interval 
    530 
    531 
    532 3.2 AXFR access
    533 
    534 The access list for AXFR should be set with provide-xfr:
    535 in the nsd config file. This is per zone. See nsd.conf(5).
    536 For example to grant zone 'example.com' AXFR right to localhost for
    537 IPv4 and IPv6, use the below config options.
    538 
    539 zone:
    540 	name: "example.com"
    541 	provide-xfr: 127.0.0.1 NOKEY
    542 	provide-xfr: ::1 NOKEY
    543 
    544 You can use dig @localhost example.com axfr to test this.
    545 
    546 
    547 3.3 Using TSIG
    548 
    549 NSD supports TSIG for any query to the server, for zone transfer
    550 and for notify sending and receiving.
    551 
    552 TSIG keys are based on shared secrets. These must be configured
    553 in the config file. To keep the secret in a separate file use 
    554 include: "filename" to include that file.
    555 
    556 An example tsig key named sec1_key.
    557 
    558 	key:
    559 		name: "sec1_key"
    560 		algorithm: hmac-md5
    561 		secret: "6KM6qiKfwfEpamEq72HQdA=="
    562 
    563 This key can then be used for any query to the NSD server. NSD
    564 will check if the signature is valid, and if so, return a signed
    565 answer. Unsigned queries will be given unsigned replies.
    566 
    567 The key can be used to restrict the access control lists, for
    568 example to only allow zone transfer with the key, by listing
    569 the key name on the access control line.
    570 
    571 	# provides AXFR to the subnet when TSIG is used.
    572 	provide-xfr: 10.11.12.0/24 sec1_key
    573 	# allow only notifications that are signed
    574 	allow-notify: 192.168.0.0/16 sec1_key
    575 
    576 If the TSIG key name is used in notify or request-xfr lines,
    577 the key is used to sign the request/notification messages.
    578 
    579 
    580 3.4 Zone expiry of secondary zones
    581 
    582 NSD will keep track of the status of secondary zones, according to the 
    583 timing values in the SOA record for the zone.  When the refresh time of a
    584 zone is reached, the serial number is checked and a zone transfer is
    585 started if the zone has changed.  Each master server is tried in turn.
    586 
    587 Master zones cannot expire.  They are always served.  Zones are master
    588 zones if they have no 'request-xfr:' statements in the config file.
    589 
    590 After the expire timeout (from the SOA record at the zone apex) is reached,
    591 the zone becomes expired. NSD will return SERVFAIL for expired zones,
    592 and will attempt to perform a zone transfer from any of the masters.
    593 After a zone transfer succeeds, or if the master indicates that the SOA 
    594 serial number is still the same, the zone will be OK again.
    595 
    596 In contrast with e.g. BIND, the inception time for a slave zone is stored
    597 on disk (in the xfrdfile: "xfrd.state"), together with timeouts.  If a
    598 slave zone acquisition time is recent enough, this means that NSD can start
    599 serving a zone immediately on loading, without querying the master server.
    600 
    601 If your slave zone has expired, and no masters can be reached, but you 
    602 still want NSD to serve the zone.  (i.e. ''My network is in shambles, but
    603 serve the zone dangit!'').  You can delete the file 'xfrd.state',
    604 but leave the zonefile for the zone intact.  Make sure to stop nsd before
    605 you delete the file, as NSD writes it on exit.  Upon loading NSD will treat
    606 the zonefile that you as operator have provided as recent and will serve
    607 the zone.  Even though NSD will start to serve the zone immediately,
    608 the zone will expire after the timeout is reached again.  NSD will also
    609 attempt to confirm that you have provided the correct data by polling 
    610 the masters.  So when the master servers come back up, it will transfer
    611 the updated zone within <retry timeout from SOA> seconds.
    612 
    613 In general it is possible to provide zone files for both master and
    614 slave zones manually (say from email or rsync). Reload with SIGHUP
    615 or nsd-control reload to read the new zonefile contents into the name
    616 database.  When this is done the new zone will be served. For master
    617 zones, NSD will issue notifications to all configured 'notify:' targets.
    618 For slave zones the above happens; NSD attempts to validate the zone
    619 from the master (checking its SOA serial number).
    620 
    621 
    622 3.5 Diagnosing NSD log entries
    623 
    624 NSD will print log messages to the system log (or 'logfile:' configuration
    625 entry). Some of these messages are discussed below. These messages can
    626 get extra support if errors happen.
    627 
    628 - "Reload process <pid> failed with status <s>, continuing with old database"
    629 
    630 This log message indicates the reload process of NSD has failed for
    631 some reason.  The reason can be anything from a missing database file
    632 to internal errors.  If this happens often, please let us know, this
    633 error message can be caught in the code, and appropriate action could
    634 be taken.  We are as of yet not sure what action is appropriate, if any.
    635 
    636 - "snipping off trailing partial part of <ixfr.db>"
    637 
    638 Please let us know if, and how often, this happens.
    639 
    640 What happens is the file ixfr.db contains only part of expected data.
    641 The corruption is removed by snipping off the trailing part.
    642 
    643 - "memory recyclebin holds <num> bytes"
    644 
    645 This is printed for every reload. NSD allocates and deallocates memory
    646 to service IXFR updates. The recyclebin holds deallocated memory ready
    647 for future use. If the number grows too large, a restart resets it.
    648 
    649 - "xfrd: max number of tcp connections (32) reached."
    650 
    651 This line is printed when more than 32 zones need a zone transfer at the
    652 same time.  The value is a compile constant (xfrd-tcp.h), but if this
    653 happens often for you, we could make this a config option.  NSD will reuse
    654 existing TCP connections to the same master (determined by IP address)
    655 to transfer up to 64k zones from that master.  Thus this error should
    656 only happen with more than 32 masters or more than 64*32=2M zones that
    657 need to be updated at the same time.
    658 
    659 If this happens, more zones have to wait until a zone transfer completes
    660 (or is aborted) before they can have a zone transfer too. This waiting
    661 list has no size limit.
    662 
    663 - "error: <zone> NSEC3PARAM entry <num> has unknown hash algo <number>"
    664 
    665 This error means that the zone has NSEC3 chain(s) with hash algorithms
    666 that are not supported by this version of NSD, and thus cannot be served
    667 by NSD.  If there are also no NSECs or NSEC3 chain(s) with known hash
    668 algorithms, NSD will not be able to serve DNSSEC authenticated denials
    669 for the zone.
    670 
    671 
    672 3.6 Interfaces
    673 
    674 NSD will by default bind itself to the system default interface and
    675 service ip4 and if available also ip6. It is possible to service only ip4
    676 or ip6 using the -4, -6 commandline options, or the ip4-only and ip6-only
    677 config file options.
    678 
    679 The commandline option -a and config file option ip-address can be given
    680 to bind to specific interfaces.  Multiple interfaces can be specified.
    681 This is useful for two reasons:
    682 	o The specific interface bound will result in the OS bypassing
    683 	  routing tables for the interface selection.  This results in
    684 	  a small performance gain.  It is not the performance gain that
    685 	  is the problem, sometimes the routing tables can give the
    686 	  wrong answer, see the next point.
    687 	o The answer will be routed via the interface the query came from.
    688 	  This makes sure that the return address on the DNS replies is the
    689 	  same as the query was sent to.  Many resolvers require the source
    690 	  address of the replies to be correct.  The ip-address: option is
    691 	  easier than configuring the OS routing table to return the DNS
    692 	  replies via the correct interface.
    693 The above means that even for systems with multiple interfaces where you
    694 intend to provide DNS service to all interfaces, it is prudent to specify
    695 all the interfaces as ip-address config file options.
    696 
    697 With the config file option ip-transparent you can allow NSD to bind to
    698 non local addresses.
    699 
    700 
    701 3.7 Tuning
    702 
    703 NSD is performant by design and most users will have little need for tuning
    704 it. For setups that do require every ounce of performance, NSD offers a number
    705 of configuration options.
    706 
    707 
    708 cpu-affinity, server-<N>-cpu-affinity and xfrd-cpu-affinity
    709 
    710 Modern computer systems have many cores available. By default the operating
    711 system's scheduling-algorithm determines which core a given task is allocated
    712 to. Processors build up state, like keeping frequently accessed data in cache
    713 memory, for the task (process/thread) that it is currently running. Whenever,
    714 a task switches cores, performance is degraded because the core it switched
    715 to has yet to build up said state. The cpu-affinity configuration options can
    716 be used to bind NSD to one or more cores.
    717 
    718 cpu-affinity can be used to designate a set of cores onto which NSD processes
    719 are scheduled. server-<N>-cpu-affinity and xfrd-cpu-affinity can be used to
    720 designate a specific core to each individual process. This improves L1/L2
    721 cache hits and reduces pipeline stalls/flushes.
    722 
    723 For example, a name server configured to fork two NSD servers that must run on
    724 dedicated cores 0 and 2, while the transfer daemon (xfrd) must run on core 1,
    725 the configuration becomes.
    726 
    727 	server:
    728 		server-count: 2
    729 		cpu-affinity: 0 1 2
    730 		server-1-cpu-affinity: 0
    731 		server-2-cpu-affinity: 2
    732 		xfrd-cpu-affinity: 1
    733 
    734 
    735 ip-address: x.x.x.x  servers=<N>
    736 
    737 ip-address options can be configured per (set of) server(s). Sockets that are
    738 configured for a specific server are closed by other servers on startup. This
    739 improves select/poll performance and avoids waking up multiple servers when a
    740 packet comes in.
    741 
    742 
    743 ip-address: x.x.x.x  bindtodevice=yes
    744 ip-address: x.x.x.x  setfib=<N>
    745 
    746 The bindtodevice attribute on Linux and the setfib ip-address attribute on
    747 FreeBSD can be used to skip the interface selection process in the kernel. This
    748 improves performance, and ensures responses written to the socket are pushed
    749 out the same interface the corresponding query came in on when multiple
    750 interfaces are configured to listen on the same subnet.
    751 
    752 The aforementioned options all complement eachother and best performance is
    753 achieved by assigning a socket to a single server that runs on a dedicated
    754 core and line that up with a dedicated network interface. Network interface
    755 interrupts are best handled by a core not designated to any NSD servers.
    756 
    757 	server:
    758 		server-count: 3
    759 		cpu-affinity: 0 1 2 4
    760 		server-1-cpu-affinity: 0
    761 		server-2-cpu-affinity: 1
    762 		server-3-cpu-affinity: 2
    763 		xfrd-cpu-affinity: 4
    764 		ip-address: 1.2.3.11  servers=1 setfib=1 bindtodevice=yes
    765 		ip-address: 1.2.3.12  servers=2 setfib=2 bindtodevice=yes
    766 		ip-address: 1.2.3.13  servers=3 setfib=3 bindtodevice=yes
    767 
    768 The number of NSD servers to fork and which cores are best used depends
    769 entirely on the hardware. cpu-affinity options are supported on Linux and
    770 FreeBSD.
    771 
    772 
    773 3.8 Zone verification
    774 
    775 NSD can be configured to verify a zone is correct before publishing it. This
    776 feature is primarily aimed at fortifying DNSSEC in the DNS
    777 notify/transfer-chain, but can be used to carry out any checks desired.
    778 
    779 An external verifier can be configured per zone. When a zone with verification
    780 enabled is received or updated via an (incremental) zone transfer, it will be
    781 submitted to the verifier for evaluation. If the verifier deems the updated
    782 zone correct (indicated with exit status 0), the zone will be served. NSD will
    783 discard the update and continue to serve the zone before the update if the
    784 exit status of the verifier is non-zero.
    785 
    786 Verifier options can be configured globally in the "verify:" clause, or
    787 specifically for a zone/pattern in the respective "zone:" and "pattern:"
    788 clauses. The global values are applied by default.
    789 
    790 The zone can be provided to the verifier in two ways.
    791 
    792 	1. The complete zone can be fed to the standard input of the verifier.
    793 
    794 	   This modus operandi is enabled by default and can be configured
    795 	   with the "verifier-feed-zone:" option.
    796 
    797 	   Examples for verifiers that read from the standard input are:
    798 	   "ldns-verify-zone -V2" (-V2 to suppress copying to stdout) or
    799 	   "validns -" (don't forget the dash (-) to read the zone from stdin).
    800 
    801 	2. The zone can be served to the verifier.
    802 
    803 	   This is disabled by default and can be enabled by configuring ip-
    804 	   addresses, with the "ip-address:" option in the "verify:" clause,
    805 	   on which the zone to be assessed will be served. Addresses can
    806 	   contain a port number to override the default, which is 5347 by
    807 	   default, but can be overridden with the "port:" option in the
    808 	   verify clause.
    809 
    810 	   For example to validate the SOA of a zone example.com by querying,
    811 	   with a certain DS record as the trust anchor (in file example.com.ds),
    812 	   the "verifier:" option could have the following value:
    813 	   "drill -S -k example.com.ds @localhost -p 5347 example.com SOA"
    814 
    815 A verifier is informed about the domain name of the zone to be verified and
    816 the accessibility of the system submitting the zone via environment variables.
    817 
    818 	VERIFY_ZONE
    819 		Domain name of the zone to be verified.
    820 
    821 	VERIFY_ZONE_ON_STDIN
    822 		Contains "yes" if the zone is fed over standard input,
    823 		otherwise "no".
    824 
    825 	VERIFY_IP_ADDRESSES
    826 		Contains a list of <ip-address>@<port>s on which the zone
    827 		to be verified can be queried.
    828 
    829 	VERIFY_IPV6_ADDRESS and VERIFY_IPV6_PORT
    830                 Contains the first configured IPv6 address and port.
    831 
    832 	VERIFY_IPV4_ADDRESS and VERIFY_IPV4_PORT
    833 		Contains the first configured IPv4 address and port.
    834 
    835 	VERIFY_IP_ADDRESS and VERIFY_PORT
    836 		Contains the first configured address and port.
    837 		IPv6 is preferred over IPv4.
    838 
    839 For each zone one verifier will be run at the same time, but when multiple
    840 to-be-verified zones are received, multiple verifiers may be run
    841 simultaneously. The number of verifiers that may be run simultaneously is
    842 configured with the "verifier-count:" option in the "verify:" clause and
    843 defaults to 1.
    844 
    845 The time a verifier may take can be configured with the "verifier-timeout:"
    846 option in the "verify:" clause (to make the general default) or in the "zone:"
    847 or "pattern:" clause to set it for a specific zone. When the time the verifier
    848 takes exceeds the timeout value, the zone to be verified will be considered
    849 bad. By default the value is 0, which means that the verifier may take as long
    850 as it needs.
    851 
    852 To enable verification for all zones.
    853 
    854 	verify:
    855 		enable: yes
    856 		verifier: <command>
    857 
    858 To enable verification only for a specific zone.
    859 
    860 	verify:
    861 		enable: yes
    862 		verify-zones: no
    863 
    864 	zone:
    865 		name: example.com
    866 		verify-zone: yes
    867 
    868 
    869 4.0 Support and Feedback
    870 
    871 NLnet Labs is committed to support NSD and its other software products on 
    872 a best effort basis, free of charge. This form of community support is 
    873 offered through a mailing lists and the 'bugzilla' web interface. 
    874 
    875 	http://www.nlnetlabs.nl/bugs/
    876 
    877 If for any reason NLnet Labs would stop community support of NSD such 
    878 would be announced on our web pages at least two years in advance.
    879 
    880 The community mailing list nsd-users (a] lists.NLnetLabs.nl can be used to discuss
    881 issues with other users of NSD. Subscribe here
    882 
    883 	http://lists.nlnetlabs.nl/mailman/listinfo/nsd-users
    884 
    885 NLnet Labs recognizes that in some corporate environments this commitment to
    886 community support is not sufficient and that support needs to be codified. 
    887 We therefore offer paid support contracts that come in 3 varieties. 
    888 
    889 More information about these support varieties can be found at 
    890 	https://nlnetlabs.nl/services/contracts/
    891 
    892 Support goes two ways.  By acquiring one of the support contracts you
    893 also support NLnet Labs to continue to participate in the development
    894 of the Internet architecture. We do this through our participation in
    895 the (IETF) standards process and by developing and maintaining
    896 reference implementations of standards and tools to support operation
    897 and deployment of new and existing Internet technology. 
    898 
    899 We are interested in our users and in the environment you use NSD. Please drop
    900 us a mail when you use NSD at users (a] NLnetLabs.nl. Indicate in what kind of
    901 operation you deploy NSD and let us know what your positive and negative
    902 experiences are.
    903 
    904 4.1 Your Support
    905 
    906 NLnet Labs offers all of its software products as open source, most are
    907 published under a BSD license. You can download them, not only from the
    908 NLnet Labs website but also through the various OS distributions for
    909 which NSD, ldns, and Unbound are packaged. We therefore have little idea
    910 who uses our software in production environments and have no direct ties
    911 with 'our customers'.
    912 
    913 Therefore, we ask you to contact us at users (a] NLnetLabs.nl and tell us
    914 whether you use one of our products in your production environment,
    915 what that environment looks like, and maybe even share some praise.
    916 We would like to refer to the fact that your organization is using our
    917 products. We will only do that if you explicitly allow us. In all other
    918 cases we will keep the information you share with us to ourselves.
    919 
    920 In addition to the moral support you can also support us
    921 financially. NLnet Labs is a recognized not-for-profit charity foundation
    922 that is chartered to develop open-source software and open-standards
    923 for the Internet. If you use our software to satisfaction please express
    924 that by giving us a donation. For small donations PayPal can be used. For
    925 larger and regular donations please contact us at users (a] NLnetLabs.nl. Also
    926 see http://www.nlnetlabs.nl/labs/contributors/.
    927 
    928 
    929 Id
    930