Score:1

Ipv6 vs Ipv4: is there a way to force ipv6 use?

gq flag

Ubuntu/Linux beginner here, so I was wondering if there's any way to force Ubuntu to prefer IPv4 or IPv6 when resolving a name (ex.: google.com has ipv4 and ipv6 addresses. is there any setting which allows me to say that IPv6 should be preferred over IPv4 when some app asks for that name?)

Thanks.

Score:0
id flag

You would be able change it in the /etc/gai.conf file.

From man gai.conf:

DESCRIPTION
       A  call  to getaddrinfo(3) might return multiple answers.  According to
       RFC 3484 these answers must be sorted so that the answer with the high‐
       est  success  rate is first in the list.  The RFC provides an algorithm
       for the sorting.  The static rules are  not  always  adequate,  though.
       For  this  reason,  the  RFC  also  requires that system administrators
       should have the possibility to dynamically change the sorting.  For the
       glibc implementation, this can be achieved with the /etc/gai.conf file.

       Each  line  in the configuration file consists of a keyword and its pa‐
       rameters.  White spaces in any place are ignored.  Lines starting  with
       '#' are comments and are ignored.

There is a section in that file of commented lines that you can change. There is one line in particular that states the following:

#    For sites which prefer IPv4 connections change the last line to
#
#precedence ::ffff:0:0/96  100

Which should mean that if you want IPv4 preferred over IPv6 you would basically just have to uncomment the lines above and change the last line to what the comment is stating.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.