[nsd-users] How to dynamically add and remove zones?

W.C.A. Wijngaards wouter at nlnetlabs.nl
Tue Jun 26 08:47:21 UTC 2018


Hi Kaulkwappe,

On 26/06/18 10:32, kaulkwappe at prvy.eu wrote:
> Dear colleagues,
> 
> I'm not very familiar with nameserver software but it seems NSD is a
> quite simple and robust solution for me. But I wonder how I can
> dynamically add or remove zones without restarting the deamon?

If that pattern contains a zone file name, eg. something with the '%s'
that is replaced with the zone name, like "zones/%s.zone".  Then you can
put the zonefile with the data in that position.  Then perform the
nsd-control.  And it loads the zone into memory straight away and starts
serving it.

If the zone is transferred from another server, include the request-xfr
in the pattern, and when you add the zone it is then transferred and
service starts.

NSD writes the zone and pattern names to the zone.list file, so that it
remembers the zone has been added when you restart the server.  When you
remove it it is removed from memory and service (the zonefile is not
deleted by NSD), and the entry in the zone.list file is deleted by NSD.

You can also edit the zone into the nsd.conf config file (or another
config file included into it), and nsd-control reconfig.  The include
statement can take wildcards, eg. include: "zones/*.conf" and that can
be nice if you like to just put a file into the dir and reconfig.

Removal then works by editing nsd.conf to remove the zone and then
reconfig.  Or delete the zone.conf file and then reconfig.

Best regards, Wouter

> 
> I've used the command 'nsd-control addzone example.com {pattern-name}'
> but it does not do anything except writing that to
> '/var/lib/nsd/zone.list'. What do I have to do when I dynamically want
> to add or remove zones without downtime of the primary nameserver (master)?
> 
> Kind regards,
> Kaulkwappe
> 
> 
> _______________________________________________
> nsd-users mailing list
> nsd-users at NLnetLabs.nl
> https://open.nlnetlabs.nl/mailman/listinfo/nsd-users
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.nlnetlabs.nl/pipermail/nsd-users/attachments/20180626/54478d75/attachment.bin>


More information about the nsd-users mailing list