Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using both IPv6 and IPv4 in a LAN network containing Slackware 13.0 boxes. How can I set IPv4 as preferred protocol on the workstations in this network? I want to use IPv6 either explicitly or when there are only AAAA records available. For example, if I try to open http://ipv6.org/ from Firefox, I will always connect via IPv6. The situation is the same with other applications. I tried creating /etc/gai.conf and adding the following to it:

precedence ::ffff:0:0/96  100

This should control the behavior of getaddrinfo(3) at least in Debian, but it didn't help on Slackware.

Any ideas will be appreciated. Thanks in advance!

share|improve this question
    
Thank you very much for pointing at /etc/gai.conf! I was searching forr it for about half a year! :) –  kolypto Dec 12 '09 at 18:00

2 Answers 2

up vote 3 down vote accepted

According to the man page, inserting a precedence value in gai.conf disables the all the other default rules. Try setting all the rules as listed in RFC 3484 (10.3):

  Prefix        Precedence Label
  ::1/128               50     0
  ::/0                  40     1
  2002::/16             30     2
  ::/96                 20     3
  ::ffff:0:0/96        100     4
share|improve this answer

ipv6 isn't really my area of expertise, but on the man page for resolver(5) there seems to be a few options in /etc/resolv.conf that could be related:

options inet6 sets RES_USE_INET6 in _res.options. This has the effect of trying a AAAA query before an A query inside the gethostbyname(3) function, and of mapping IPv4 responses in IPv6 "tunneled form" if no AAAA records are found but an A record set exists.

Maybe your clients have that option set?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.