Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 1 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:
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
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
add comment

Your Answer

 
discard

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.