[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/hosts and resolving of the local host/domainname - 127.0.0.1 vs. 127.0.1.1



On Tue, 2013-07-30 at 23:15 +0100, Simon McVittie wrote:
> libnss-myhostname is basically this, and is packaged. It tries to return
> a public address if possible, only falling back to 127.0.0.2 (upstream),
> 127.0.1.1 (as patched in Debian) or ::1 (IPv6) if there's nothing more
> suitable.
Sounds nice and as Josh said, why not using it per default?

But it wouldn't change the annoyance I was mainly talking about, namely
that a non-127.0.0.1 is used.


> I would be inclined to install libnss-myhostname by default, since it's
> the 99% solution. People who feel strongly about this sort of thing can
> uninstall or disable it, and apply whatever manual configuration they
> want to.
Does it first try to determine a global IP, or does it always give
127.x.x.x respectively ::1?


> I think `getent hosts 127.0.0.1` should always return "localhost" and
> `getent hosts localhost` should always return "127.0.0.1" (and possibly
> also "::1", I'm not sure about that part).
> 
> I wouldn't have any particular objection to `getent host mymachine`
> returning 127.0.0.1 *as well* if it makes things work better.
If that doesn't break any things... and libnss-myhostname can be made
doing that... that would sound the ideal solution to me.


> [citation needed] for "most people" - hard-coding a non-loopback IP
> address is never going to work for a laptop that's used in multiple
> locations, and I hear those are quite popular these days :-)
Sure,... but there are still non-laptops/tablets... and Debian want's to
be the "universal" OS ;-)
And as I said, I've seen several weird services which don't work when
the hostname doesn't point to the global IP,... of course this is their
fault and they are especially quite severely broken in multi-homed
setups... but things are as they are and these services probably won't
change anytime soon.


> I suspect it might be quite common in Java apps developed on Windows.
Hehe... you hit the point ;-) But dCache is at least not developed in
Windows :)


> I think whether this is viable depends whether your networking is
> basically static or dynamic. If your networking is basically static (a
> typical server), almost anything is acceptable, because you won't have
> to change it very often in any case. If your networking is basically
> dynamic (a typical laptop), then hostname-to-IP-address configuration
> will have to be either automatic, loopback-based, or "usually broken".
Sure... but usually you don't run all too much such services on a laptop
anyway.



Cheers,
Chris.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Reply to: