On Tue, 24 Dec 2019 14:59:53 +0100 Anand Buddhdev <anandb at ripe.net> wrote: I do not receive my own posts, I also get "needs moderator approval" although I received a welcome to this mailinglist. Must be something wrong somewhere...> > only read these files when it receives a HUP or a restart and > > converts it to a db format. Now I need to add a domain in two > > places: 1) the > > The DB format is optional, and in fact, not recommended these days. > Just set: > > database: "" > > in your nsd.conf, and NSD will not build a database file. It will just > read zones into memory and serve from there.I use the default /var/lib/nsd/nsd.db, that's what I meant with db, just "database".> > zone file itself and 2) an include in the config file containing: > > > > zone: > > name: "example1.com" > > zonefile: "com/example1/zone" > > zone: > > name: "example2.com" > > zonefile: "com/example2/zone" > > > > That needs more scripting and I'm lazy ;-) > > Yeah, but you just need to do this once, right?Yep, that's true, but I'm too lazy sometimes :)> If you're going to be adding and removing zones on the fly, you can do > that with NSD. You can either add/remove zones in the nsd.conf file, > and reload NSD, or use "addzone" and "delzone" with nsd-control.I just had a glance at nsd-control it and indeed, I think it is nicer to invoke an "nsd-control reconfig" instead of telling the supervisor to restart nsd. OTOH, nsd does not read its config file when receiving a HUP. It would be a nice if a USR2 would force a config reload in case of a supervised setup. Maybe that's something for the wishlist. R. -- richard lucassen http://contact.xaq.nl/
On 2019/12/24 22:28, richard lucassen via nsd-users wrote:> On Tue, 24 Dec 2019 14:59:53 +0100 > Anand Buddhdev <anandb at ripe.net> wrote: > > I do not receive my own posts, I also get "needs moderator approval" > although I received a welcome to this mailinglist. Must be something > wrong somewhere... > > > > only read these files when it receives a HUP or a restart and > > > converts it to a db format. Now I need to add a domain in two > > > places: 1) the > > > > The DB format is optional, and in fact, not recommended these days. > > Just set: > > > > database: "" > > > > in your nsd.conf, and NSD will not build a database file. It will just > > read zones into memory and serve from there. > > I use the default /var/lib/nsd/nsd.db, that's what I meant with db, just > "database".The file is not required at all. Not just "leave at default", but it is usually recommended to actually disable it with database: "" Some OS builds do this by default, others don't.
On 24/12/2019 22:28, richard lucassen via nsd-users wrote:> OTOH, nsd does not read its config file when receiving a HUP. It would > be a nice if a USR2 would force a config reload in case of a supervised > setup. Maybe that's something for the wishlist.Well, NSD *does* re-read its config file on SIGHUP. However, it only reapplies those config elements that it can, such as addition or removal of zones. Other elements, such as the listening address and port, number of workers (essentially all the elements in the "server" section) cannot be changed on the fly, so NSD just ignores them. If you change any of those, you have to restart NSD. This confuses many users. It would be nice if the developers could indicate in the nsd.conf man page, which option requires a restart to take effect, and which one can be adjusted with a "reload" or "reconfig". Regards, Anand Buddhdev