What kind of DNS queries one sends out (A, AAAA, NS, PTR, SOA, TXT, ...) is pretty much independent of which network transport is carrying them to an upstream recursive server (IPv4, IPv6). It's completely legitimate to ask AAAA questions over v4 transports. I quite understand your desire not to request AAAA responses that will be unusable in the absence of any IPv6 routing. Unfortunately, this is pretty much controlled by the client app, not generically by the OS, so it's hard to completely abolish.
For the specific case of firefox, in about:config set network.dns.disableIPv6 to true.
Adjusting /etc/gai.conf isn't likely to affect A versus AAAA DNS query behavior by applications, sorry. I think you can cause IPv4 destination addresses to be preferred to IPv6 (sorted earlier in the combined getaddrinfo(3) output list) by boosting the precedence of global scope V4 mapped addresses ::ffff:0:0/96 above global scope v6 ::0, e.g. replace
Code:
precedence ::ffff:0:0/96 10
with
Code:
precedence ::ffff:0:0/96 45
per RFC 3484 section 6 rule 6. You don't need to adjust the label value; leave that alone.
Bookmarks