IPv6 and DNS PTRs
Haven't posted for a while, been busy with other more pressing issues... I finally had a bit of time to figure out one of the little niggling details that I wasn't able to get around to earlier on. PTR records for v6. Unfortunately, PTR records are a bit ugly, actually a lot ugly especially the way that Microsoft's snap-in for DNS presents it. Microsoft's IPv6 stack won't post a dynamic DNS PTR record for v6 like it does for v4. If you want one, you have to do it by hand, which is a pain (so much for DHCP and DynDNS saving the day here). It's not even real consistent with forward lookup registration either. I had a few systems that did, and some that didn't.
At any rate, the documentation on Microsoft's site is pretty good, but they do lack for examples on certain things. Creating the zone for the v6 reverse can be done two ways, the recommended way is to use the dnscmd on the cmd shell to create it. If you use the snap-in you end up with this gobblygook hierarchy since it creates a sub-level for each nibble. You can use the now deprecated INT format, or the preferred and accepted ip6.arpa format. I went with the ip6.arpa format since I didn’t have anything done yet anyway. It took me a while to figure out how to create the zone since there’s not much in the way of any examples for how to use the dnscmd. A couple of things. The server wants things in nibble format. There’s supposedly a new format out that ISC BIND 9x works with that’s a bit string which is easier, but MS hasn’t gone to that (yet?)… Nibble format is simply putting dots between each of the hex characters. You can’t abbreviate here, though, it has to be the whole deal. For example: f:1:f would be equivalently 000f:0001:000f which would be 0.0.0.f.0.0.0.1.0.0.0.f in nibble format. You’d then take this address and reverse it. For the lazy (myself included) I found a site that will take an IPv6 address and put it in nibble format and reverse it for you: http://www.ipv6.logix.cz/tools.xp
Now on to the DNS bit…
First, here’s one example system I want reverse entries for:
bridge.the-taylor-family.org (my dns server). It has an IPv6 address of: fd15:a9b8:480d:1:2d0:59ff:fe2d:62fe
The full PTR record for this would be: e.f.2.6.d.2.e.f.f.f.9.5.0.d.2.0.1.0.0.0.d.0.8.4.8.b.9.a.5.1.d.f.ip6.arpa
So, here we go. First, have to create the zone:
Network fd15:a9b8:480d::/48
Zone Name: d.0.8.4.8.b.9.a.5.1.d.f.ip6.arpa
Command to create it:
dnscmd bridge.the-taylor-family.org /zoneadd d.0.8.4.8.b.9.a.5.1.d.f.ip6.arpa /dsprimary
Here’s the breakdown:
bridge.the-taylor-family.org is the DNS server I’m creating the zone file on
/zoneadd – add a zone
zone name – 5.6.4.4.0.f.d.3.0.a.d.f.ip6.arpa (from first example)
/dsprimary – Directory AD enabled – you don’t have to do this, but it makes it easier for me since I’ve got an AD infrastructure and my DNS lives on it.
Next since I was already scripting things, here’s the command to add a reverse lookup:
dnscmd bridge.the-taylor-family.org /recordadd d.0.8.4.8.b.9.a.5.1.d.f.ip6.arpa e.f.2.6.d.2.e.f.f.f.9.5.0.d.2.0.1.0.0.0 PTR bridge.the-taylor-family.org.
That’s actually one long line so don’t split it when you’re doing your own. Once again:
bridge… DNS server
/recordadd – adding a record (PTR in this case)
d.0.8.4.8.b.9.a.5.1.d.f.ip6.arpa – is the zone I’m dumping it in
e.f.2.6.d.2.e.f.f.f.9.5.0.d.2.0.1.0.0.0 – this is the reversed host portion with subnet of the address in nibble format (see link above for lazy folks like me)
Unfortunately, the records get added as a long list of sub-networks in the DNS server due to the way that MS does their bit. Oh well, maybe Longhorn will fix that. Hope this helps somebody else as I would have appreciated this information the easier way rather than having to trial-n-error myself through it…