IPv6 Records on an IPv4 Network

Phil Mayers p.mayers at imperial.ac.uk
Fri Jul 23 12:50:20 UTC 2010


On 23/07/10 13:23, Danny Mayer wrote:
> On 7/22/2010 11:33 AM, Phil Mayers wrote:
>> On 22/07/10 12:19, Rock July wrote:
>>> Windows Vista and 7 clients will query both type A and AAAA query even
>>
>> The OS might make the query, but the application will (should) be using
>> getaddrinfo, and this will return the IPv4 addresses first, so it
>> doesn't matter.
>
> This is untrue. IPv6 addresses are normally returned first though the
> ordering depends on a) the order returned by the authorative nameserver
> and b) by the resolving server and if it reorders the list returned.
> There is no specific ordering of resource records specified in the
> protocol and servers are free to order them in any way they want. It is
> up to the application to specify what they need and to make decisions on
> which ones they will use.


Perhaps we are talking about two different things here?

Certainly there is no defined ordering of A versus AAAA records in DNS 
replies.

However, on Linux and Windows at least, the getaddrinfo C library call 
defaults to AI_ADDRCONFIG and RFC3484 address ordering rules; it does 
sort the results, and will present IPv4 results first if there is no 
local IPv6 global address present.

For example, in a Python interpreter session on a Windows XP machine:


 >>> socket.getaddrinfo('wildfire.net.ic.ac.uk', 22)
[(23, 0, 0, '', ('2001:630:12:1c2f:203:47ff:fee7:ddac', 22, 0, 0)), (2, 
0, 0, '', ('155.198.51.19', 22))]

 >>> p = subprocess.call(['ipv6', 'uninstall'])

 >>> socket.getaddrinfo('wildfire.net.ic.ac.uk', 22)
[(2, 0, 0, '', ('155.198.51.19', 22))]



More information about the bind-users mailing list