1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

IPv4/IPv6 preference

Discussion in 'Networking' started by Abacus, Jul 7, 2010.

  1. Abacus

    Abacus New Member

    Messages:
    6
    Likes Received:
    0
    Hi there,

    I've been Googling this for about 20 minutes and haven't found anything relevant. On Linux, the configuration file gai.conf allows me to set getaddrinfo() to prefer AAAA records over A records when doing a DNS lookup. I can't find an equivalent on FreeBSD.

    All I found was this page, which says "FreeBSD prefers IPv6 if a DNS query results in IPv4 and IPv6 addresses being sent back (A and AAAA RRs)". This doesn't seem to be the case.

    I know for certain that v4v6.ipv6-test.com does have both AAAA and A records, but FreeBSD is preferring to connect via IPv4. When I put an IPv6-only address into my browser (v6.ipv6-test.com), FreeBSD does connect over IPv6 as it should (so I know for certain that both IPv6 and IPv4 are working fine, it's just a matter of preferring one over the other in a DNS lookup).

    Any ideas?
     
  2. aragon

    aragon New Member

    Messages:
    2,031
    Likes Received:
    0
  3. Abacus

    Abacus New Member

    Messages:
    6
    Likes Received:
    0
    Perfect. Thank you.
     
  4. athei

    athei New Member

    Messages:
    1
    Likes Received:
    0
    Just used this to make IPv6 default in FreeBSD10.0. Do these changes survive reboot?
     
  5. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    7
    Add to /etc/rc.conf:
    Code:
    ip6addrctl_enable="YES" # Set to YES to enable default address selection
    ip6addrctl_verbose="NO" # Set to YES to enable verbose configuration messages
    ip6addrctl_policy="AUTO"        # A pre-defined address selection policy
                                                # (ipv4_prefer, ipv6_prefer, or AUTO)