[dns-operations] Link-local IP addresses for a resolver?
Viktor Dukhovni
ietf-dane at dukhovni.org
Tue Sep 24 20:09:30 UTC 2019
On Sep 24, 2019, at 3:13 PM, Tony Finch <dot at dotat.at> wrote:
> I did a bit of a survey in 2014 and found that prominent DNS
> libraries didn't support link-local addresses back then
> http://lists.cluenet.de/pipermail/ipv6-ops/2014-July/010035.html
> Maybe it's better now :-)
FWIW, I've recently put in some cycles into improving a not so
prominent DNS stub resolver library (for Haskell):
https://github.com/kazu-yamamoto/dns
It uses getaddrinfo(3) to parse the upstream resolver address
from /etc/resolv.conf (or explicit application overrides):
https://github.com/kazu-yamamoto/dns/blob/master/Network/DNS/Resolver.hs#L103-L111
so I expect that scopes should work, but have not tested this.
To the extent that DNS stub-resolver code-bases are updated to use
getaddrinfo(3) rather than inet_pton(3) and the like, they would
automatically benefit from any scope support in getaddrinfo(3).
The getaddrinfo manpage on my FreeBSD system reads in part:
This implementation of getaddrinfo() allows numeric IPv6 address notation
with scope identifier, as documented in chapter 11 of RFC 4007. By
appending the percent character and scope identifier to addresses, one
can fill the sin6_scope_id field for addresses. This would make
management of scoped addresses easier and allows cut-and-paste input of
scoped addresses.
At this moment the code supports only link-local addresses with the
format. The scope identifier is hardcoded to the name of the hardware
interface associated with the link (such as ne0). An example is
“fe80::1%ne0”, which means “fe80::1 on the link associated with the ne0
interface”.
The current implementation assumes a one-to-one relationship between the
interface and link, which is not necessarily true from the specification.
--
Viktor.
More information about the dns-operations
mailing list