Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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
up vote 9 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


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.