zone file/named.conf creation script?

Kevin Darcy kcd at daimlerchrysler.com
Fri Jan 4 03:28:12 UTC 2002


If your zonefile contents are sufficiently template-able, you may be able
to get away with using a common zone file for all of your zones. Just use
dot-terminated strings for any names which are constant for all zones
(e.g. maybe all of the www.foo.com and www.bar.com names are aliases to a
bigvserver.maindomain.com name), and non-dot-terminated strings for any
names which you want to be relative to the name of the zone (e.g.
mail.foo.com, mail.bar.com, etc.). Then just point the "file" clause in
each "zone" statement to the same file, e.g.

zone "foo.com" { type master; file "common"; };
zone "bar.com" { type master; file "common"; };

If this is possible, then generating the zone definitions from the domain
list is a snap:

sed 's/.*/zone "&" { type master; file "common"; };/' < domain_list

Who needs Perl anyway?


- Kevin
shmoppy wrote:

> Hello, I'm wondering if there are any tools or scripts out there that
> will create zone files and modify named.conf using a text list of
> domains and a standard template for the zone info (A, NS, ip, etc).
> I've got a very large text list of domains that will be virtual hosted
> to add to my dns server.
>
> This sounds like it could be accomplished with a very simple script
> but my perl knowledge is sketchy at best so I thought I'd ask around
> before trying to dive in and do it myself. Thanks!



More information about the bind-users mailing list