3

I have this directory structure:

\etc\nsd3
   |- nsd3.conf
   |- zones
   |   |- zonefile.com.zone
   |   |- zonefile2.com.zone

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

voxobscuro
  • 163
  • 7

1 Answers1

4

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:
server:
    # static configuration here

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

#!/bin/sh    
for i in /etc/nsd3/zones/*.zone
do
    printf "zone:\nname: %s\nzonefile: %s\n" "$(basename $i zone)" "$i"
done > /etc/nsd3/zones.conf
schot
  • 646
  • 5
  • 11
  • 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 09 '11 at 18:48