Home | History | Annotate | Line # | Download | only in doc
      1 NSD 4 features
      2 
      3 By W.C.A. Wijngaards, NLnet Labs, 2012.
      4 
      5 Migration
      6 ---------
      7 The old NSD3 config file can be used without changes for NSD4.  There are
      8 new config statements and some old statements are gone.
      9 
     10 The nsd.db file has a new format that allows read and write.  Thus the
     11 nsd.db file needs to be re-created in NSD4 format.  This happens when
     12 you start NSD4.  NSD4 needs write permission on the nsd.db directory
     13 for that.  If you need to rollback to NSD3, run its zonec to recreate
     14 the NSD3 nsd.db file (use nsdc rebuild).
     15 
     16 The cron job for nsdc patch is no longer needed.  It can be removed.
     17 
     18 If you admire cron jobs, you can have a cron job that does "nsd-control
     19 write".  This would periodically write the contents of changed zones to
     20 their zonefile.
     21 
     22 nsdc is removed, reload with kill -HUP $pid and use nsd-control.
     23 The SIGHUP makes NSD4 check zone file timestamps and reload changed zones.
     24 nsd-control reload is the same.  SIGTERM stops NSD.
     25 
     26 You probably want to install and enable some of the new NSD 4 features,
     27 such as set up nsd-control and statistics.  And you may want to use the
     28 new pattern config options.
     29 
     30 Removed config options
     31 ----------------------
     32 difffile: ixfr.db is gone.  This setting is no longer applicable, because
     33 the ixfr.db file is no longer used.  Files are created in /tmp now.
     34 The value is ignored by NSD4 if given in nsd.conf.
     35 
     36 ip4-only and ip6-only: are replaced with more straightforward do-ip4 and
     37 do-ip6.  They are still accepted in nsd.conf for backwards compatibility.
     38 
     39 New config options
     40 ------------------
     41 zonelistfile: zone.list.  This file contains a plain text listing of
     42 the dynamically added zones and their pattern.  It is read and written
     43 by NSD while it is running.
     44 
     45 xfrdir: /tmp.  This directory is used to store temporary zone transfer
     46 files.  They are stored in a unique subdirectory that has few access
     47 permissions.
     48 
     49 tcp-count: 100.  This option already exists in NSD3, but in NSD4 you
     50 can increase it above 1024, like 2048, to have higher TCP capacity.
     51 
     52 remote-control: this is a new section in the config file that configures
     53 the nsd-control remote control utility.  It is very similar to unbound's
     54 remote control configuration.  With control-enable: yes you can enable
     55 it, it is disabled by default.  It is bound to the loopback interface
     56 by default.  See the manpage or sample config for the list of options,
     57 it is possible to set the port number and keyfile paths, and configure
     58 it to be accessible from the outside.
     59 
     60 pattern: these allow you to bundle a set of zone config statements.
     61 Then for a zone you can include-pattern: "nameofpattern" to apply those
     62 config statements.  patterns can also include other patterns.  This is
     63 needed to allow the user to specify the config statement pattern for a
     64 newly added zone.  But you can also use it to organise the configuration.
     65 
     66 zone: These already exist in NSD3 and work similarly.  For NSD4,
     67 they create a zone, these zones added and removed by a restart or the
     68 nsd-control reconfig command.  Zones that are dynamically added can
     69 also be dynamically removed (with nsd-control addzone and delzone),
     70 those zones are in the zones.list file. The zone can have the normal
     71 zone config statements, and it can also use include-pattern to apply
     72 config statements from a pattern to it.
     73 
     74 The nsd-control utility
     75 -----------------------
     76 You can control the NSD4 daemon with signals, SIGHUP, SIGTERM, if you
     77 want.  It reloads on SIGHUP and this includes parsing and loading changed
     78 zone files.  More commands are available via the nsd-control utility.
     79 It connects over SSL with the daemon and sends the command to it, and
     80 prints the result.
     81 
     82 To enable nsd-control you have to create the private and public keys
     83 with nsd-control-setup, run it as root.  Then edit nsd.conf and set
     84 remote-control: control-enable: yes in the config file.  Then you should
     85 be able to use nsd-control, the nsd-control status command is a simple
     86 check if everything works.
     87 
     88 reload [zone] : without a zone name it checks if zone files have changed,
     89 if so, loads them.  If you specify the zone name (nsd-control reload
     90 example.com) it'll load that zone.
     91 
     92 reconfig : this rereads the nsd.conf file without a restart.  Only the
     93 zone configuration, and ratelimits are updated from it.  Other settings,
     94 file paths, chroot location, interfaces and port numbers, cannot
     95 be applied and need a restart, during the restart NSD will have the
     96 permissions to bind port 53 and chroot again.  It adds and removes
     97 zones that have been added and removed in the config file, and it also
     98 changes zone configurations.
     99 
    100 log_reopen : also done on SIGHUP, but this controls more exactly that only
    101 the logfile is reopened.
    102 
    103 stats and stats_noreset : print statistics.
    104 
    105 addzone name pattern : adds a new zone to the running server.  If it has a
    106 zonefile this file is read in and served.  If it is a slave zone, a zone
    107 transfer is attempted.
    108 
    109 delzone name : removes zone.
    110 
    111 write [zone] : write a zone contents from nsd.db to its zonefile in text format.
    112 writes all changed zones, but if you specify a particular zone, it writes
    113 that zone only.
    114 
    115 notify [zone] : for master zones here, send notifies to its slaves.
    116 If you specify a name, only that zone, otherwise all master zones.
    117 
    118 transfer [zone] : for slave zones here, attempt a zone transfer from
    119 the masters.  If you specify a name, only that zone, otherwise all
    120 slave zones.
    121 
    122 force_transfer [zone] : same as transfer but uses full zone transfer
    123 with AXFR and does not perform a serial number check.
    124 
    125 Statistics
    126 ----------
    127 With nsd-control you can get a list of statistics from NSD on demand.
    128 This makes it easier to integrate NSD into a statistics collection system.
    129 In source/contrib/nsd_munin_ is an example munin plugin.
    130 
    131 Other features
    132 --------------
    133 * Performance increase.
    134 * Support a high zone count.
    135 * Faster zone transfers.
    136 * Add and remove zones without a restart.
    137 * Can reread zone configuration from config file without a restart.
    138 * Higher TCP service levels, more sockets.
    139 * Detect which zone files have changed.
    140 * Calculates nsec3-prehash incrementally after IXFR.
    141 * Domain tree does not have the small leak of domain nodes.
    142 
    143 More documentation
    144 ------------------
    145 The nsd(8) man page, the nsd.conf(5) man page, the nsd-control(8) man page.
    146 
    147