I write or modify programs that do name resolution and have good control over the process. Therefore, I do not use getaddrinfo(), I go deeper and use res_query()/ res_send()/ etc in resolv.h, documented in resolver (3).
Although the documentation is not documented, the general way to install the inverter used is to upgrade _res.nsaddr_list. But this array, defined in resolv.h, stores
struct sockaddr_in, that is, only IPv4 addresses. (IPv6 addresses
struct sockaddr_in6, a family-specific system will use struct sockaddr.)
I am looking for a way (preferably portable, at least among various Unix), to report _resthat I want IPv6 addresses as well.
Apparently, a long time ago a appeared in FreeBSD _res_extwith this, but I can not find it in recent FreeBSD 7 ( grep
_res_ext /usr/include/resolv.hit does not find anything). You can still find the
code that uses it (try with Google Codesearch ).
Thanks to Alnitak, I noticed that he, apparently, is now _res._ext, not .res_ext. I wonder where these things are documented or announced ... I have no idea how portable it is _res._ext. I can find it on Debian and FreeBSD. It seems that there are several programs that use it.
source
share