How to make miredo prefer IPv6 DNS records?
Sorry for the IPv6-newbie question, but I hope someone can shed some light.
I'm using recent Debian Squeeze, with default miredo 1.2.3-1 installation
(kernel 2.6.32-25, and libc6 2.11.2-6+squeeze1). It works just fine out of
the box as far as IPv6 connectivity itself is concerned (great!!). The
system is just a workstation connected via etherenet to cable router, which
does IPv4-only PPTP tunnel to the ISP.
I can ping6, telnet etc to any manually specified IPv6 address, or to DNS
name that has only AAAA record.
However, when I try to connect to a DNS name that has both AAAA and A
records, "A" record always gets tried first. I would like to reverse that,
that is for "AAAA" record to always be tried first.
for example:
# host ipv6.google.com
ipv6.google.com is an alias for ipv6.l.google.com.
ipv6.l.google.com has IPv6 address 2a00:1450:8006::93
# telnet ipv6.google.com 80
Trying 2a00:1450:8006::93...
Connected to ipv6.l.google.com.
works ok, but:
# host www.ipv6.org
www.ipv6.org is an alias for shake.stacken.kth.se.
shake.stacken.kth.se has address 130.237.234.40
shake.stacken.kth.se has IPv6 address 2001:6b0:1:ea:202:a5ff:fecd:13a6
# telnet www.ipv6.org 80
Trying 130.237.234.40...
Connected to shake.stacken.kth.se.
connects to IPv4 address while I would like it to connect to IPv6 one.
The same "problem" occurs with other apps like firefox, etc.
/etc/miredo.conf contains just default lines:
InterfaceName teredo
ServerAddress teredo-debian.remlab.net
I've tried using several different DNS server (from my ISP, opendns, even
google's 8.8.8.8) and the result is the same.
I STFW, and the best I could come up is that this behavior is due to the way
getaddrinfo(3) works, and is controlled by /etc/gai.conf. It looked exactly
like what I needed... Only I couldn't make it work. By default in Squeeze,
that file contains just comments, and says that IPv6 will be prefered by
default, and gives info how to reverse that that.
I've tried uncommenting and playing with stuff that according to docs should be
defaults, like:
label ::1/128 0
label ::/0 1
label 2002::/16 2
label ::/96 3
label ::ffff:0:0/96 4
label fec0::/10 5
label fc00::/7 6
label 2001:0::/32 7
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 10
but it still does not work (even when documentation says that IPv6 DNS
will be prefered by default unless that last line is changed to
"precedence ::ffff:0:0/96 100")
By this point I'm getting out of my IPv6 depth. So I though I'd ask on the
list before delving into RFC 3484 and wasting time trying to debug the glibc
source to figure out what is going on...
Note of interest: on the same system, when aiccu (with SixXS) is installed
instead (without any other changes to the system, eg. the same gai.conf
etc), IPv6 works "correctly" (meaning as I want it -- DNS resolving first
giving IPv6 and IPv4 only if that fails). Which is why I ask on this list.
Does anyone knows why aiccu and miredo behave differently, and more
importantly how to force miredo installtion to also prefer IPv6 to IPv4?
Thanks!
--
--
Opinions above are GNU-copylefted.