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