BIND IPv6 $GENERATE

From Playing with linux...
Revision as of 09:00, 21 March 2012 by 2001:610:300:64::e (talk)
Jump to navigation Jump to search

There is no $GENERATE command available on IPv6, therefore you must specify every forward and reverse entry in bind manually. You could however use the $INCLUDE statement to include a range you have generated with a script. I will post a script here to generate IPv6 forward and reverse files you can include in bind.

generate-forward-ipv6.sh

  1. !/bin/sh
  2. generate these lines:
  3. ip20-042 IN AAAA 2001:dead:beef:14::2a
  4. where 20(0x14) is the vlanid and 42(0x2a) is the host part

if [ -z $1 ]; then

echo "usage: $0 <vlanid>"
exit

fi vlanid=$1 counter=1 while [ $counter -le 20 ]; do

printf "ip$vlanid-%03d\tIN\tAAAA\t2001:610:300:%x::%x\n" $counter $vlanid $counter;
counter=`expr $counter + 1`

done