I'm really sorry about sounding like a broken record here but the answer to your question is that it should pick the IPv6 address if you have IPv6 connectivity. This is standard behavior (RFC 3484) that can be overriden by local policy.
Sorry, but RFC 3484 isn't intended to apply to network architecture tools like ping, as it would introduce unpredictability. Indeed, RFC 3484 cautions against this in the Introduction:
In such cases, a simple policy to always prefer IPv6 or always prefer IPv4 can produce poor behavior.
Hence the "standard behaviour" your quote isn't what you think. Network architects and engineers need to be able to test connectivity for specific protocol families. Ping's job isn't some mushy "can I get some response for some domain name", it's "can I get a response from the host at address X".
No it is not a minor issue. Many think that because their world is IPv4 only and they don't yet have to deal with a world running both protocols.
I have not only run and maintained a dual-stack IPv4/IPv6 network for the last several years, I did some of my graduate research in this area, have taught advanced networking at the honours level at a major university, and have actually written an ICMPv6 library. I know what I'm talking about.
Like I said before and like I will undoubtably have to say a thousand times again before people start understanding there is no reliable way to know before you run the ping utility what protocol the destination host is running.
As I'll say now and hopefully won't have to say a thousand times more: you have no idea what you're talking about.
First off, of course ping has no way of knowing what protocol family the destination host is running. That's not its job, nor its purpose. Ping also can't automatically account for one host responding to multiple addresses (perfectly permissible in an IPv4-only network as well as an IPv4/IPv6 network). It can't account for hosts that don't respond to ICMP requests. It also can't account for servers that aren't listening on specific application ports, nor for server applications that don't return any data. If you are diagnosing network problems, those issues are YOUR job, not ping's. All that ping can do is test connectivity for a specific protocol family from one host to another, and report on the results. And you can only trust the results when they're positive and you're getting responses (if you don't get a response, that doesn't mean the host is down. It could simply be ignoring ICMP requests as many public hosts do these days).
The other day I was trying to troubleshoot why I could not get to a carriers web site. I used ping but it returned the IPv4 address. The problem turned out to be an issue with IPv6 connectivity. I had no clue the site was on IPv6 and the v4 result I got back was less than useless.
So you used the wrong tool for the job at hand, and your response is that the tool is at fault?
You could have run into exactly the same fault in an IPv4-only network. DNS doesn't enforce one name==one host; it is possible for one name to point to a number of hosts, with the local OS using some form of policy to choose between them (round robin, FIFO, random, etc.). Google is a good example -- ay my location, "dig google.com A +short" returns six different IPs. One or more of those could (theoretically) be offline at any given time, which won't be reflected by doing a simply "ping google.com" if ping picks the IP of a host that is online. If ping decides to use a different IP than my web browser, then I can't trust that the ping is representative of what I'd expect to see in the application.
This is an old problem, which predates IPv6. Proper network architects and developers know that the only way to properly debug such a situation is to know the address of the host your application is trying to reach, and then debug from there. You missed this step completely, and are blaming the tool.
Ideally, what should happen is that the browser should have some way to determine the address used to grab the resources from a given host. I admittedly don't know of a browser that offers such functionality, but ideally it should be available. Because again, regardless of protocol family, you can run into exactly the same situation you've run into within the same address family (browser resolving hostname to one address, other tools resolving to another). The proper way to diagnose this in the absence of application-supplied destination addresses is to use a network stack analysis tool like Wireshark. Get the TCP SYN packet being open against the host, and check the destination address in the IP packet encapsulating the TCP SYN. Get the address form there, and continue your analysis (here is actually a good time to use ping -- you know the specific address you're trying to reach, see if the host is reachable).
All the other major OS vendors seem to have it right...Whats wrong with Linux?
Actually, none of the major OSs work as you describe. Windows 7 requires the use of a -6 parameter, otherwise it assumes IPv4. Mac OS X 10.7 has separate ping and ping6 utilities, just like Linux (and uses the BSD implementations -- indeed, you can browser the source for their implementation here). FreeBSD's IPv6 Internals documentation also specifies separate ping and ping6 utilities.
Sorry, but you have no ide what you're talking about. You've mischaracterized an RFC (which contradicts your characterization right in the Introduction -- it even gives an example!), gave an example where you used the wrong tool for the job, and whinged about having to make your erroneous claims over and over again (that should have given you a clue). If ping worked as you describe (and it doesn't, in any implementation), it would be unpredictable. Ping isn't intended to be the end-all diagnosis tool -- you have to know what you're doing to use it properly, and to determine the proper context of when to use it. It's YOUR job to know the address and address family being used by applications before just randomly pinging host names and expecting relevant results. It's not ping's fault that you seem to not understad this.
Yaz