Jeremy Ardley <jer...@ardley.org> writes: > On 27/3/23 19:48, Richmond wrote: >> >> So how is the preference determined? It seems to be determined by the >> DNS, but why or how do I tell for example with host -v? > > When you as a DNS about a hostname it can return an A record and/or an > AAAA record. > > The A record is IPv4 and the AAAA record is IPv6 > > When you get both it is then up to your application to choose IPv4 or > IPv6 for the connection. > > If either fails the application will then try the other before finally > failing. > > You need a DNS that can return A and AAAA records, and an application > that can use either. > > I have noticed in my debian LAN that utilities such as ssh prefer IPv6 > and if that is not possible will use IPv4
Both DNS return AAAA records. I am not sure why this choice of DNS should make a difference. host -v ip6.me |grep AAAA IN AAAA 9306 IN AAAA 2001:4838:0:1b::201 host -v ip6.me 8.8.8.8|grep AAAA IN AAAA 10800 IN AAAA 2001:4838:0:1b::201 host -v ip6.me 79.79.79.78|grep AAAA IN AAAA 300 IN AAAA 2001:4838:0:1b::201