Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this directory structure:

   |- nsd3.conf
   |- zones
   |   |-
   |   |-

Currently I have to add an entry into nsd3.conf for each zonefile I wish to source to provide DNS for.

Is there a way to have nsd3 source all the zonefiles in the zones/ directory?

Thanks -vox

share|improve this question
up vote 4 down vote accepted

You can't do this with the normal NSD3 config file: NSD does not know (or care) about your naming scheme for zone files. Implementing such a thing would violate it's KISS design principle.

Another issue that make this difficult is that, unlike BIND, NSD doesn't automatically generate master/slave zone transfer ACL's from the zone file. So you would still have to specify these somehow.

But you can of course generate (part of) your NSD config with a script that does this for you. A quick mock up:

# nsd.conf:
    # static configuration here

include: "/etc/nsd3/zones.conf"

for i in /etc/nsd3/zones/*.zone
    printf "zone:\nname: %s\nzonefile: %s\n" "$(basename $i zone)" "$i"
done > /etc/nsd3/zones.conf
share|improve this answer
Its nice to get some confirmation about this. I was hoping someone would show some workaround besides scripting it. I've implemented a similar solution myself. Thanks. – voxobscuro May 9 '11 at 18:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.