The beloved UNC path name, familiar to all who administer Microsoft. After all these years there is something comfortable and familiar in the simple act of cracking open open that run line and busting out a pair of backslashes followed by the name or IP address to which I want to connect. Simple. Easy. Classic.
But the Uniform Naming Convention (UNC) path names and IPv6 addresses don’t play nicely together. If, for instance, you were to try \fe80::21a:a0ff:fe89:9dc4%12 (the %12 identifies the interface and is technically needed because the address is a link-local address) you would be immediately met with an error message. After slamming your head against the wall for a few hours you might come to realize that UNC names don’t support colons (or the percent sign, for that matter). Oops. UNC and IPv6 and incompatible with each other.
Microsoft worked around this by implementing something called IPv6 Literal Names. There is absolutely nothing elegant about this solution but …it works. If you want to use IPv6 addresses in your UNC paths you have to do the following:
- Replace colons (:) with dashes (-)
- Replace percent sign (%) with the letter ‘s’. This is only necessary if you are using a link-local IPv6 address. Global Unicast and Unique Local addresses don’t require interface identifiers.
- Slap an .ipv6-literal.net at the end of the IPv6 address (after the interface ID, if required)
That means that this (which is wrong): \fe80::21a:a0ff:fe89:9dc4%12,
will be re-written to this (which is right): \fe80–21a-a0ff-fe89-9dc4s12.ipv6-literal.net (note the double-dash used to represent the double-colon)
Yep, really. Seriously. Thanks for the aneurysm, Microsoft.
It’s been a long time and I still forget about the lack of support for IPv6 addresses in UNC path names. I’m glad the workaround is there but it’s about as ugly as it can get. One thing is for certain: I love DNS and multicast name resolution even more than ever.