I was getting annoyed by manually configuring an IPv6 reverse domain.
For reverse DNS, you need to break the IP address up into pieces (bytes for IPv4, nibbles for IPv6), reverse them, put dots between pieces, to get a domain name. Then at that domain name, you put a reference to the hostname for that IP.
So an IP address like
2001:8b0:7c:1:216:76ff:fe16:755a turns into a domain name
a.184.108.40.206.1.e.f.f.f.220.127.116.11.18.104.22.168.0.0.c.22.214.171.124.b.126.96.36.199.0.2.ip6.arpa., and there you can find a PTR record pointing to the hostname
Forming those long domain names was/is quite awkward, and its a task well suited to automation. All of the hosts already have forward DNS entries, so there's not even much additional information needed to generate the reverse zone.
I wrote a tool (in an unholy alliance of Haskell and dig) which queries a bunch of forward zones and outputs the appropriate reverse DNS records ready for pasting into a zone file.
You specify zones (and appropriate servers) that will be asked for AAAA records; then all of the AAAA records which refer to IPv6 addresses on the specified network will be converted into PTR records and sent to stdout, ready to paste into a zone file.
$ dnsrz firstname.lastname@example.org email@example.com firstname.lastname@example.org email@example.com --prefix=200108b0007c0001 188.8.131.52.0.0.0.0.0.0.0.0.0.0.0.0 PTR clifford.ac. 184.108.40.206.0.0.0.0.0.0.0.0.0.0.0.0 PTR malander.clifford.ac. 220.127.116.11.0.0.0.0.0.0.0.0.0.0.0.0 PTR malander.mrsclifford.eu. 18.104.22.168.0.0.0.0.0.0.0.0.0.0.0.0 PTR fecolith.clifford.ac. 22.214.171.124.0.f.e.f.f.f.3.9.d.0.2.0 PTR pomade.clifford.ac. a.126.96.36.199.1.e.f.f.f.188.8.131.52.2.0 PTR dildano.hawaga.org.uk. c.0.2.a.4.c.e.f.f.f.3.6.b.1.2.0 PTR newsnowdrop.mrsclifford.eu. 0.a.0.c.b.a.e.f.f.f.184.108.40.206.2.0 PTR tenesmus.clifford.ac. 7.2.f.0.1.9.e.f.f.f.b.220.127.116.11.0 PTR coprolith.clifford.ac. c.2.5.d.b.f.e.f.f.f.b.e.7.2.a.b PTR pygar.hawaga.org.uk. c.2.5.d.b.f.e.f.f.f.b.e.7.2.a.b PTR pygar-6.hawaga.org.uk. b.18.104.22.168.f.e.f.f.f.8.c.c.b.a.c PTR laptop.hawaga.org.uk.
I wanted to use the Haskell dns package which I've used a bit before; but it didn't have enough features: no zone transfer capability, for a start... so I invoke
dig and parse that out.
The commandline syntax is: <zonename>@<DNS server> where zonename is a forward zone, and the specified server will answer AXFRs for that zone. Thats quite icky but it gets around needing a full Haskell DNS implementation.
The code is on github under benclifford/dnsrz.(later: as fits my tradition of writing a tool and then finding someone has done something similar first, bind comes with a tool
arpanamewhich will convert an IP address into a reverse name, though it doesn't do all the other stuff above, but does work for ipv4 too: http://ftp.isc.org/isc/bind9/cur/9.9/doc/arm/man.arpaname.html