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


Groups > linux.debian.user > #256466

Re: Which takes priority, ipv4, or ipv6?

From davenull@tuxfamily.org
Newsgroups linux.debian.user
Subject Re: Which takes priority, ipv4, or ipv6?
Date 2023-03-28 13:00 +0200
Message-ID <Gefdv-fENc-7@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 2023-03-27 13:48, Richmond wrote:
> I have configured an ipv6 tunnel. If I visit this site:
> 
> http://ip6.me/
> 
> The "normal" test shows my ipv4 address, and the:
> 
> http://ip6only.me/
> 
> shows the ipv6 address.
> 
> However if I switch my DNS from opendns to the one provided by my ISP
> and then run the "normal" test it shows the ipv6.
> 
> The note says:
> 
> (preference depends on your OS/client)
> 
> 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?

That's weird… It should not be reslover-dependant unless your default 
resolver either don't support IPv6 which seems not to be the case, or 
(wrongfully) prioritize IPv4 unless the resolved name has IPv6 only?

In "normal" context, it's not determined by the DNS resolver, but it can 
be limited by the DNS resolver, of course if the resolver answers for 
IPv4 only (A record).

If the resolver can return both IPv4 and IPv6 records, and both your OS 
and application supports it, which debian does and most half-decent web 
browser do, then the OS or application config decides whether enable 
IPv6 or not.  If IPv6 is enabled, it should be prioritized and IPv4 is 
used as fallback if IPv6 fails (e.g, when connecting to an IPv4 only 
server, or using IPv4 only resolvers, if those still exist).

For debian and multiple other distros, it depends on systemd settings. 
On debian, IPv6 can be disabled in /etc/sysctl.conf, as far as I know it 
is enabled by default, unless need to add line(s) like

net.ipv6.conf.all.disable_ipv6 = 1

To /etc/sysctl.conf, then reload the file with sysctl command, or 
reboot. Note that "=1" mean disable, NOT enable, since the option names 
are in the negative form.

PS: For Non-debian-like systemd-based distros, espcially RHEL, Fedora 
and so on have a different path for these options. I don't remember the 
exact but there's no /etc/sysctl.conf
And For non-systemd distros, it is usually a bootloader option. for 
GRUB, it's the "ipv6.disable=1" parameter to the 
"GRUB_CMDLINE_LINUX_DEFAULT" in "/etc/default/grub" file

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