Method of writing zone files

Mark Andrews marka at isc.org
Mon Nov 12 23:21:35 UTC 2018


It really depends on the platform.

Windows doesn’t support atomic replacement via rename.

On platforms where atomic replacement via rename is supported it is used.

Mark

> On 13 Nov 2018, at 6:39 am, Marcus Frenkel <marcus.frenkel at gmail.com> wrote:
> 
> Thank you for the quick reply Tony!
> 
> Follow-up questions just to be sure:
> 1. The new zone file is renamed in the placed of the old one, only after all changes to the new file are written?
> 2. Is the zone file atomically replaced during the renaming process, in a sense that there is no window in which the file is empty or non-existent?
> 
> I'm running BIND on Debian 9. Based on this Linux man page, the rename function should be atomic. I would not imagine that BIND does it in different way, like the worst case scenario to first remove the current file and then move the new one to the same path. I know I'm too cautious, I'm just trying to avoid any chance for rsync to transfer incomplete or empty zone file, or maybe delete the file at the destination if it does not exist at the source for a short moment.
> 
> Marcus
> 
> On Mon, Nov 12, 2018 at 7:19 PM Tony Finch <dot at dotat.at> wrote:
> Marcus Frenkel <marcus.frenkel at gmail.com> wrote:
> >
> > I need to know how BIND writes to slave zone files after zone has been
> > updated. Does it modify the file in place or it replaces the file with
> > new one at once?
> 
> Changes are written to a journal append-only style. Every so often the
> master file is rewritten to incorporate the contents of the journal; this
> is done by writing to a new file and renaming it in place of the old one.
> 
> Tony.
> -- 
> f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
> sovereignty rests with the people and authority
> in a democracy derives from the people
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list
> 
> bind-users mailing list
> bind-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users

-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742              INTERNET: marka at isc.org



More information about the bind-users mailing list