Question on slave

Hello,

I am switching from djbdns and have a (probably dumb) question before going live with nsd:

When syncing between master and slaves, am I supposed to see new files appear in the slave's "zonesdir" directory? Because, as you might expect, I see nothing here. Is this behavior normal? From what I understand, the slave "caches" the data in /var/lib/nsd/nsd.db (I'm using debian).

What I have done is create the whole master config (with all the zones and notify+provide-xfr fields) and, on the slave, only defined the "server" part of the config and, for each zone, the allow-notify and request-xfr fields.

When, on the slave, I execute "nsd-control force_transfer gosane.fr" i just get an "ok" message.

Then "nsd-control zonestatus gosane.Fr" spits out:
zone: gosane.fr
state: ok
served-serial: "2023110103 since 2023-12-04T12:39:04"
commit-serial: "2023110103 since 2023-12-04T12:39:04"
wait: "80812 sec between attempts"

That looks fine to me (the slave had no way to know the serial). Also querying the slave directly gives me the right answers.

Can anyone confirm that it is working as expected?

Thanks for your help,

JC

Hi Jean-Christophe,

When syncing between master and slaves, am I supposed to see new files appear in the slave's "zonesdir" directory? Because, as you might expect, I see nothing here. Is this behavior normal? From what I understand, the slave "caches" the data in /var/lib/nsd/nsd.db (I'm using debian).

By default, NSD doesn't write out zone files on the secondary. It stores all the data in nsd.db, as you've observed.

You can make NSD write out zone files, by setting the option "zonesfile-write" to a number above 0, and setting "zonefile" to something like "<zonename>.zone" for each secondary zone. NSD will then write out changed zones to plain text files. This is in *addition* to saving the zone data in nsd.db.

Alternatively, you can disable the database altogether by setting "database" to the empty string. Then, NSD will not create nsd.db, and will instead write out zone files every hour (this is for efficiency, to prevent too many disk writes on a busy secondary server).

Note that the "database" option is deprecated, and will go away with the upcoming 4.8.0 release. So you should probably disable it in your config too.

Regards,
Anand Buddhdev

Hi Jean-Christophe,

Anand's answer is entirely correct.

Once 4.8.0 is released, zone files will be written once per hour by
default.

Best regards,
Jeroen

I'm confused now :slight_smile:

Arnand said the "database" option is being removed. Does this mean
the database will always be created, or NEVER be created?

I always wondered why I had both the .db and the zone files. After
reading this first response, I was thinking I could cancel the zone
files from being produced.

But now, reading your reply, it appears that the nsd.db is being
deprecated, and the zonefiles will be the only option. Is this correct?

Cheers, Jamie

Yes. 4.8 will only use zone files, the "database" option will be ignored. Pre 4.8 versions can disable the "database" as Anand wrote bevor.

Klaus

Thanks for the clarification. It will be nice to stop the duplication!

Cheers, Jamie