My ideas about this problem:

Other apps can do IPv4/IPv6 resolution correctly, without such delays, and without the explicit need to enable IPv6. So it Can Be Done. This is the given, which we have to work with. So what's wrong? How do we fix it properly?

A likely cause of the problem is broken home NAT boxes which don't respond to AAAA queries at all, then mIRC times out after 15 seconds or so.

The recommended way to do DNS resolution is to use getaddrinfo(), the standard API lookup. I checked that this lookup, whereever i tried (both linux and windows), completely omits the AAAA lookup, if the PC has no IPv6 connectivity. This is done, explicitly, as a workaround for such broken NAT routers. If using getaddrinfo is impossible, then omit the AAAA lookup if IPv6 connectivity lacks. To know if you have IPv6 connectivity, look for the presence of global scope IPv6 addresses.

edit: i remember/read elsewhere that you do use getaddrinfo(), but you manually resolve v4 and v6 on their own. first, i advise against this, because the OS is designed to do this properly, taking care of all the edge cases, to make ipv6 work *without problems*. you're misusing the API. secondly, because you manually do v4 and v6 lookups independently, the above applies.

Last edited by beware; 03/09/10 10:46 PM.