IPv6 and IPv4 resolver preferences

Felipe Alfaro Solana felipe_alfaro at linuxmail.org
Thu Sep 16 22:10:11 UTC 2004


On 16/09/2004, at 21:58, Steve G wrote:
>
>> Will this change anytime soon? Any comments on this?
>
> If you want IPv6 prefered over IPv4, go into /etc/resolv.conf and set
>
> options inet6
>
> Does this help?

No, it doesn't. Although the glibc resolver asks first for the AAAA 
host record, the results returned to the client still map the IPv4 in 
first place. In fact, the resolver behaves erratically. My scenario:

I have a client computer named hostA, and a server computer named 
hostB. hostB has a IPv4 A RR (resolves to 192.168.0.1) and a IPv6 AAAA 
RR (resolves to 2000::1). When client hostA tries telnetting hostB, 
this is what ethereal records if "options inet6" is set in 
"/etc/resolv.conf":

from hostA to nameserver, standard query AAAA hostB
from nameserver to hostA, standard query response AAAA 2000::1
from hostA to nameserver, standard query A hostB
from nameserver to hostA, standard query response A 192.168.0.1
from hostA to nameserver, standard query A hostB
from nameserver to hostA, standard query response A 192.168.0.1
from hostA to nameserver, standard query AAAA hostB
from nameserver to hostA, standard query response AAAA 2000::1
from hostA to hostB(192.168.0.1), 32805 > telnet [SYN] Seq=0 Ack=0 
Win=5840...

As you can see, the hostA resolver is querying twice for A and AAAA RR, 
which seems completely strange.

And this is what ethereal reveals if "options inet6" IS NOT set in 
"/etc/resolv.conf":

from hostA to nameserver, standard query AAAA hostB
from nameserver to hostA, standard query response AAAA 2000::1
from hostA to nameserver, standard query A hostB
from nameserver to hostA, standard query response A 192.168.0.1
from hostA to nameserver, standard query A hostB
from nameserver to hostA, standard query response A 192.168.0.1
from hostA to nameserver, standard query A hostB
from nameserver to hostA, standard query response A 192.168.0.1
from hostA to hostB(192.168.0.1), 32806 > telnet [SYN] Seq=0 Ack=0 
Win=5840...

This time, the resolver is querying three times for the A RR of host B. 
Also, the telnet connection is done against the IPv4 address, and not 
the IPv6 address as I expected.

What's going on here?





More information about the fedora-devel-list mailing list