$GENERATE in zone files and how to use it

Andris Kalnozols andris at hpl.hp.com
Sun Jul 14 20:13:05 UTC 2002


> Nico Kadel-Garcia <nkadel at bellatlantic.net> wrote:
> 
> Is there any decent bind 8.x or 9.x documentation on how to use the
> $GENERATE option in the zone files? And what are the performance trade-offs
> of using it? I've also gone poking through the O'Reilly DNS book, and
> searched the Linux bind documentation, but found no good references.

You'll find some documentation in the following relative paths
in the BIND distribution:

BIND 8:  doc/html/master.html
BIND 9:  doc/arm/Bv9ARM.ch06.html

I would think that letting the name server self-load zone data
from a $GENERATE directive would be more efficient that reading
and parsing the equivalent amount of text records.

> I've succeeded in some tests with it, but I'd like to be able to use
> zero-filled numbers as well. For examble IP addresses 1-254 in a /24 get
> listed as foo001.bar.coom through foo254.bar.com. As it is, I seem to
> require 3 distinct commands to get it right in the bar.com zone file.
> 
>     $GENERATE    1-9            foo00$ A 192.168.1.$
>     $GENERATE    10-99        foo0$   A 192.168.1.$
>     $GENERATE    100-254    foo$     A 192.168.1.$
> 
> Is that the only way to do it?

$GENERATE  1-254   foo${0,3}   A    192.168.1.$


Andris



More information about the bind-users mailing list