BIND 9.8 and ipv6 reverse records

The $GENERATE directive in a zone file includes nibble mode, which means you can do things like this



; reverse IPV6 zone file for example.com
$TTL 2d    ; default TTL for zone 172800 secs
$ORIGIN 0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
@         IN      SOA   ns1.example.com. hostmaster.example.com. (
                        2003080800 ; sn = serial number
                        12h         ; refresh = refresh
                        15m        ; retry = update retry
                        3w         ; expiry = expiry
                        2h         ; min = minimum
                        )
; name servers Resource Recordsfor the domain
          IN      NS      ns1.example.com.
; the second name servers is 
; external to this zone (domain).
          IN      NS      ns2.example.net.
; PTR RR maps a IPv6 address to a host name
; hosts in subnet ID 1
$GENERATE 0-4294967295  ${0,15,n}.0.0.0.0.1.0.0.0 PTR 2001-0db8-0000-0001-0000-0000-${0,15,n}.example.com.


After adding the zone of course !


zone "0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa" {
        type master;
        file "/etc/bind/ipv6.rev.local";
};

Comments

jb said…
The Generate line is incorrect. You did not account for the decimal character in the width section.

You have: $GENERATE 0-4294967295 ${0,15,n}.0.0.0.0.1.0.0.0 PTR 2001-0db8-0000-0001-0000-0000-${0,15,n}.example.com.

Here is the correct line.

$GENERATE 0-4294967295 ${0,23,n}.0.0.0.0.1.0.0.0 PTR 2001-0db8-0000-0001-0000-0000-${0,23,n}.example.com.
John B said…
How to generate for 1220:2a80::/32

Popular posts from this blog

Baileys liquor Chocolate Chip and Cream desert

using t1n1wall, opnsense or pfsense on Google Compute Engine GCE

nginx decode base64 url for use with imgproxy