>>>>> "D" == Daniel Berger <djberg96 / attbi.com> writes:

D> Couldn't you simply check RES_USE_INT6 and call gethostbyname or 
D> gethostbyname2 as appropriate?  I'm looking at Stevens, "Unix Network 
D> Programming", p.240-249

 RFC 2553

6.1 Nodename-to-Address Translation

   The commonly used function gethostbyname() is inadequate for many
   applications, first because it provides no way for the caller to
   specify anything about the types of addresses desired (IPv4 only,
   IPv6 only, IPv4-mapped IPv6 are OK, etc.), and second because many
   implementations of this function are not thread safe.  RFC 2133
   defined a function named gethostbyname2() but this function was also
   inadequate, first because its use required setting a global option
   (RES_USE_INET6) when IPv6 addresses were required, and second because
   a flag argument is needed to provide the caller with additional
   control over the types of addresses required.



Guy Decoux