[systemd-devel] nss-myhostname: why don't loopback interfaces appear?

Daurnimator quae at daurnimator.com
Tue Jun 2 23:31:12 PDT 2015

On 3 June 2015 at 16:01, Lennart Poettering <lennart at poettering.net> wrote:
> On Wed, 03.06.15 15:40, Daurnimator (quae at daurnimator.com) wrote:
>> I was playing around with nss, and found that my loopback interface ip
>> doesn't appear from nss-myhostname.
>> Rather, my other ones do.
>> Furthermore, unless I request IPv4, link-local IPv6 addresses are
>> returned. Is this expected?
> We order the returned addresses by scope. Global addresses are
> placed first, local ones last.

Then why are link local IPv6 addresses returned first?

If this was the case, I would expect to see:

> We return addresses on the loopback device only when there's no other
> address known.

What's the rationale for this? (i.e. why not always just include and ::1 last?)

> And even then we'll return rather than
>, to avoid confusing software that expects "localhost" mapping
> only to and vice versa.
> Also see nss-myhostname(8).

More information about the systemd-devel mailing list