Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #256479

Re: Which takes priority, ipv4, or ipv6?

From Andy Smith <andy@strugglers.net>
Newsgroups linux.debian.user
Subject Re: Which takes priority, ipv4, or ipv6?
Date 2023-03-28 17:40 +0200
Message-ID <GejAt-fHDj-1@gated-at.bofh.it> (permalink)
References <GdTG1-frks-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Mar 27, 2023 at 12:48:13PM +0100, Richmond wrote:
> So how is the preference determined? It seems to be determined by the
> DNS, but why or how do I tell for example with host -v?

I'm not adding anything new here, only pulling together what has
already been said in several different replies.

There are three main places where this can be affected.

Firstly the DNS servers you use can decide on their own what to
return to you. Normally it's expected that a resolver is going to
return everything that is in the DNS zone for the query you made,
but some DNS servers (both authoritative and resolver) do decide to
give you filtered results which may for example exclude AAAA
records. No AAAA records, no possibility of an IPv6 connection.

Secondly, your application that gets a list of answers (A and AAAA
records) might do something special. It is after all free to do
whatever it is programmed to do. The most common example of this is
"Happy Eyeballs", where (simply put) web browsers connect to BOTH A
and AAAA and use whichever works first.

Thirdly, if no special handling is in use then your operating
system chooses which address to use. There's an RFC for that, and
all of that is configured in /etc/gai.conf on Debian. The default
behaviour is to try IPv6 first.

So, DNS tools like "host" will not answer this question for you
because that is only showing you the first part. That's enough to
show you what your options are, but your app might use those options
in a way you weren't expecting. Some apps might not even support
IPv6. For most apps /etc/gai.conf controls this.

You mentioned in another email that you had to alter gai.conf to
make IPv6 be preferred. That is unusual as it is not the expected
default behaviour.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Which takes priority, ipv4, or ipv6? Richmond <dnomhcir@gmx.com> - 2023-03-27 14:00 +0200
  Re: Which takes priority, ipv4, or ipv6? Jeremy Ardley <jeremy@ardley.org> - 2023-03-27 14:00 +0200
    Re: Which takes priority, ipv4, or ipv6? Richmond <dnomhcir@gmx.com> - 2023-03-27 14:20 +0200
      Re: Which takes priority, ipv4, or ipv6? Jeremy Ardley <jeremy@ardley.org> - 2023-03-27 14:20 +0200
  Re: Which takes priority, ipv4, or ipv6? Vincent Lefevre <vincent@vinc17.net> - 2023-03-27 14:10 +0200
    Re: Which takes priority, ipv4, or ipv6? Richmond <dnomhcir@gmx.com> - 2023-03-27 15:30 +0200
  Re: Which takes priority, ipv4, or ipv6? Michael Stone <mstone@debian.org> - 2023-03-27 21:00 +0200
  Re: Which takes priority, ipv4, or ipv6? davenull@tuxfamily.org - 2023-03-28 13:00 +0200
  Re: Which takes priority, ipv4, or ipv6? Andy Smith <andy@strugglers.net> - 2023-03-28 17:40 +0200
    Re: Which takes priority, ipv4, or ipv6? Tim Woodall <debianuser@woodall.me.uk> - 2023-04-02 07:20 +0200

csiph-web