Re: nsd question

2018-09-12 Thread Craig Skinner
Hi Peter,

On Tue, 11 Sep 2018 16:12:48 +0200 Peter J. Philipp wrote:
> 
> If I'm correct, in order to pull the zones to disk on a slave nsd
> setup, one has to manually or crontab "nsd-control write
> example.com". Is this correct?

Sort of;- a slave NSD instance would XFER the zones from it's master
into memory and serve the changed zones authoritatively. But, it
wouldn't write the updated zones to it's slave files cached on disk.
On daemon restart, it would try to XFER them all again.

To reduce the flurry of XFERs and log messages after daemon restart or
machine reboot, I had a cron job to write the slave zones to disk,
run by my 'hostmaster' user (root wasn't needed).

When OpenBSD 5.9 was released, it included a newer version of NSD,
which done this itself via the new 'zonefiles-write' in nsd.conf

My cron job has been retired as NSD now caches its slave files itself.

Happy hostmastery!

Cheers,
-- 
Craig Skinner | http://linkd.in/yGqkv7



Re: nsd question

2018-09-11 Thread Florian Obser
On Tue, Sep 11, 2018 at 04:12:48PM +0200, Peter J. Philipp wrote:
> Hi,
> 
> I wasn't going to ask, but the book I have (alternative dns servers - jpm) is
> somewhat outdated on nsd.
> 
> If I'm correct, in order to pull the zones to disk on a slave nsd setup, one
> has to manually or crontab "nsd-control write example.com".  Is this correct?
> 
> Is there an automated way to do this in the server or must I crontab this?

nsd.conf(5) has this:

   zonefiles-write: 
  Write changed secondary zones to their zonefile every N seconds.
  If the zone (pattern) configuration has "" zonefile, it is not
  written.  Zones that have received zone transfer updates are
  written to their zonefile.  Default is 0 (disabled) when there
  is a database, and 3600 (1 hour) when database is "".  The
  database also commits zone transfer contents.  You can configure
  it away from the default by putting the config statement for
  zonefiles-write: after the database: statement in the config
  file.

Default is to have no database, so on a slave it takes an hour to write to disk.

> 
> What I'm worried on is not writing any zone material to disk and then having
> a mishap on my delphinusdnsd primary server.  A sudden restart could make
> nsd forget zones if they weren't written to disk somehow right?
> 

yes, it will answer servfail

> Thanks and best regards,
> 
> -peter
> 

-- 
I'm not entirely sure you are real.



nsd question

2018-09-11 Thread Peter J. Philipp
Hi,

I wasn't going to ask, but the book I have (alternative dns servers - jpm) is
somewhat outdated on nsd.

If I'm correct, in order to pull the zones to disk on a slave nsd setup, one
has to manually or crontab "nsd-control write example.com".  Is this correct?

Is there an automated way to do this in the server or must I crontab this?

What I'm worried on is not writing any zone material to disk and then having
a mishap on my delphinusdnsd primary server.  A sudden restart could make
nsd forget zones if they weren't written to disk somehow right?

Thanks and best regards,

-peter