Creating Zone Files (using BIND) - how to batch create over 200 zones in one go

4 posts / 0 new
Last post
#1 Wed, 03/23/2016 - 17:46

Creating Zone Files (using BIND) - how to batch create over 200 zones in one go

I am moving servers and need to set up many hundreds of zone files on new server, ready for migration. The BIND control panel does not seem to have an option for creating loads of zone files from say a text list of domains. (All domains have the same template entires).

I have searched and searched for an answer, but no joy.

Anyone have a clue please. Prefer to have a text file listing all the domains and just run like a DOS batch file if possible.

Thanks in advance!

Wed, 03/23/2016 - 22:56


Are you looking to create 200 new Virtual Servers (domains), all with the BIND DNS domain feature enabled, is that what you're asking?

Also, just to verify -- are you migrating from another existing Virtualmin server? Or are your existing servers not in a Virtualmin environment?

A few thoughts come to mind --

One, you could always use the command line tools to help. You can see the various options by running the command "virtualmin" as root.

Two, within Virtualmin, there is an option for mass creating domains in Add Servers -> Batch Create Virtual Servers.

And three, if you're migrating from an existing Virtualmin server, an easy way to handle this would be to generate a set of backups, and just copy those backups to the new server.


Thu, 03/24/2016 - 06:44

HI, Thanks for response.

We have around 300 zone files on another server, NOT with virtualmin but another system altogether.

There are only a few virtual servers running but all these zones will point to the server and be aliased into the relevant domain through httpd.conf entries.

However, I still need to generate 300+ identical zone files for the server and looking to save time and effort.....but have to do this weekend one way or another

Thu, 03/24/2016 - 10:58

Would one of the above options I mentioned work in that case?

One of my favorite options is using the command line tools... if you had a list in a text file, you could just write a script that looped over that text file, and created then all one-by-one. You mentioned they'd be aliases, that should be no problem as well, you can create aliases using the command line as well.


Topic locked