Delete multiple zones in version 4 and 3

Hi list

We run version 4.1.20 (master on CentOS 7) and 3.2.16 (slave on Debian
7) . I know, we should urgently update our slave :slight_smile:
We would like to remove multiple zones (several hundert) and I was
wondering what best practice is since it would mean lots of manual work
and a great potential of error to do it manually.

Is there a best practice or maybe even a script of some kind?

Thank you

Hi Jochen,

depends a little on your configuration, but: how about 'nsd-control' and
the 'delzone' or 'delzones' command?

See:

The command should remove the domain(s) from the zonelist, if you have
them separated from your nsd.conf.

Only the actual zone files have to be remove separately.

Hi Andreas,

in nsd.conf we defined the zones.
delzone does not remove those zone definitions from nsd.conf. I have to do it manually it says.

On the other hand nsd-control isn’t available at nsd 3.x, right?

Jochen

Hi Jochen,

We run version 4.1.20 (master on CentOS 7) and 3.2.16 (slave on Debian
7) . I know, we should urgently update our slave :slight_smile:
We would like to remove multiple zones (several hundert) and I was
wondering what best practice is since it would mean lots of manual work
and a great potential of error to do it manually.

Is there a best practice or maybe even a script of some kind?

In both NSD 3 and 4, any zones defined in nsd.conf can only be removed
by editing that config file. And then NSD 3 has to be completely
restarted for the change to be noticed. NSD 4 can be reconfigured on the
fly with "nsd-control reconfig".

Coming back to your question about how to remove lots of zones from
nsd.conf safely: well, the answer is: do it carefully!

Instead of editing it by hand, you should probably do it with a script,
so that the chances of errors are reduced, unless of course you have
bugs in your script.

This is why you should keep your zone definition in some kind of config
management system, and have it generate your nsd.conf from a template.

Regards,
Anand