Include `::1 localhost` in /etc/hosts
Richard Laager
rlaager at wiktel.com
Thu Apr 21 03:14:02 UTC 2022
On 4/20/22 15:48, Treysis wrote:
> Not having localhost to resolve to ::1 is getting problematic.
Why? Can you elaborate on the issue(s) you're seeing?
I've always assumed the trade-off is as follows:
A) localhost resolves to ::1 (with or without 127.0.0.1 too)
Pro: Things can use IPv6 instead of IPv4 locally.
Pro: It becomes easier to have IPv6-only systems.
Con: If a daemon doesn't listen on ::1, but does on 127.0.0.1,
this change potentially breaks it. If the client(s) use
IPv4 only, then as long as localhost points to both, it
won't break. But if the client prefers IPv6, then it will
break. If the client uses Happy Eyeballs, it will work,
probably with slightly increased initial latency.
B) localhost resolves to only 127.0.0.1
Pro: Daemons that listen only on 127.0.0.1 (because they're old)
or only do so by default (because their default config is old
or the user's config is old) still work.
Con: IPv6 doesn't get exercised as much.
Con: It's harder to have an IPv6-only system.
All that said, at work, my systems have an /etc/hosts that is templated
from Ansible, and my template for Debian and Ubuntu is based on Debian
which points localhost to both 127.0.0.1 and ::1. I've not had any
problems with that.
It's way too late to change this for 22.04, but changing it for 22.10
might be ideal. That would give the maximal time to shake out bugs
before the next LTS.
--
Richard
More information about the Ubuntu-devel-discuss
mailing list