Right, as I found out during my original tests (it was actually a beta-tester who pointed out the inconsistent results at the time) the getaddrinfo() function behaves differently under XP and 7 and returns different results in different situations. I am not sure how it behaves under Windows 2000 or Vista as I do not have them installed just now.

That is the reason I decided not to enable IPv6 by default. Since the majority of mIRC users do not use IPv6, I did not want to risk distributing mIRC with IPv6 enabled with the result being that even more users would experience connection issues.

Under Windows 7, getaddrinfo() appears to return the expected results (at least under my Windows 7 installation and the 6in4 client I am using) ie. it returns IPv6 addresses only when an IPv6 connection is available and prioritizes them above IPv4 addresses. So I could enable IPv6 by default under Windows 7. However I am still not comfortable with doing that without wider testing to ensure that it is reliable and consistent across Windows 7 installations and 6in4 clients.

Note: You cannot test this issue using mIRC itself since mIRC implements DNS resolution of IPv4 and IPv6 addresses as two separate getaddrinfo() calls to ensure consistent behaviour across different versions of Windows.