Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

host hostname not found

606 views
Skip to first unread message

Podrigal, Aron

unread,
Sep 4, 2014, 8:30:02 PM9/4/14
to
Any idea what can be the cause? I am installing proxmox-ve and when starting pve-cluster it fails with [main] crit: Unable to get local IP address. So I tried to look up with host utility and it does not resolve.

host localhost
Host localhost not found: 3(NXDOMAIN)

/etc/hosts
127.0.0.1       localhost


in /etc/nsswitch.conf  I have
hosts:          files dns

Jonathan Dowland

unread,
Sep 5, 2014, 2:20:03 AM9/5/14
to
On Thu, Sep 04, 2014 at 08:26:38PM -0400, Podrigal, Aron wrote:
> Any idea what can be the cause? I am installing proxmox-ve and when
> starting pve-cluster it fails with [main] crit: Unable to get local IP
> address. So I tried to look up with host utility and it does not resolve.

What does "grep hosts /etc/nsswitch.conf" give you?

Do you have libnss-myhostname installed?


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140905061...@bryant.redmars.org

Reco

unread,
Sep 5, 2014, 2:50:01 AM9/5/14
to
Hi.

On Thu, Sep 04, 2014 at 08:26:38PM -0400, Podrigal, Aron wrote:
> Any idea what can be the cause? I am installing proxmox-ve and when starting pve-cluster it fails with�[main] crit: Unable to get local IP address. So I tried
> to look up with host utility and it does not resolve.
>
> host localhost
> Host localhost not found: 3(NXDOMAIN)

This is the way it should be - you DNS tells you that it knows nothing
about localhost hostname (because host utility only does DNS requests).
If you need to test the validity of /etc/hosts, you should use:

getent hosts localhost


> /etc/hosts
> 127.0.0.1 � � � localhost
>
>
> in /etc/nsswitch.conf �I have
> hosts: � � � � �files dns

While this may look good, I believe you're missing a customary entry
pointing to your hostname in /etc/hosts. I.e.

<your_static_ip_here> <your_hostname_here>

Reco


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140905064815.GA14984@x101h

Podrigal, Aron

unread,
Sep 5, 2014, 10:50:02 AM9/5/14
to

I did not have libnss-myhostname installed. I think it was always shipped with the debian installation, at least on wheezy 7.4 through 7.5, I now had wheezy 7.6 installed, Was this changed in 7.6 or I'm just wrong?

However I installed libnss-myhostname, amd I am now able to start proxmox pve-cluster, which I wasn't able before due to failing local dns lookup.

But still when I do host localhost, I still get not found.  Is that the intended behavior? I just checked on different environments and I see tjat on mac os im also getting not found for localhost. So looks like Reco is right that thos is intended behavior. But on my other debian boxes < 7.6 it does work, so my question is why does it work there? So in short, was there any change in the last release?

Thanks

Brian

unread,
Sep 5, 2014, 12:20:01 PM9/5/14
to
On Fri 05 Sep 2014 at 10:49:15 -0400, Podrigal, Aron wrote:

> I did not have libnss-myhostname installed. I think it was always shipped
> with the debian installation, at least on wheezy 7.4 through 7.5, I now had
> wheezy 7.6 installed, Was this changed in 7.6 or I'm just wrong?

libnss-myhostname is "Priority: extra" and has no reverse depends, so it
would not be expected to come with any Wheezy release.

> However I installed libnss-myhostname, amd I am now able to start proxmox
> pve-cluster, which I wasn't able before due to failing local dns lookup.

There is no failing local DNS lookup. It has pointed been out your
/etc/hosts has a line missing. It would look like this

127.0.1.1 hostname

or this

127.0.1.1 hostname.domain hostname

and is put there by the installer.

libnss-myhostname works without that line being present.

What does "getent hosts $(hostname)" give?

> But still when I do host localhost, I still get not found. Is that the
> intended behavior? I just checked on different environments and I see tjat
> on mac os im also getting not found for localhost. So looks like Reco is
> right that thos is intended behavior. But on my other debian boxes < 7.6 it
> does work, so my question is why does it work there? So in short, was there
> any change in the last release?

It isn't possible for the host command to come up with an IP for
localhost using the DNS. You have a possible misconfiguration.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/2014090516...@copernicus.demon.co.uk

Podrigal, Aron

unread,
Sep 5, 2014, 6:20:01 PM9/5/14
to
ok, a fresh install of debian 7.6, here is my settings, I don't have libnss-myhostname installed yet

root@test1:~# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 test1.test.com test1

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


root@test1:~# getent hosts $(hostname)
127.0.1.1       test1.test.com test1


root@test1:~# cat /etc/nsswitch.conf 
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis



root@test1:~# host -v $(hostname)
Trying "test1"
Host test1 not found: 3(NXDOMAIN)
Received 98 bytes from 8.8.8.8#53 in 14 ms


Clearly, it skips /etc/hosts entries.


After digging around, I noticed, that I had always setup DNS records for my hosts prior to doing the installations, which caused me the confusion on what was happening. I thought that the looking up my hostname resolves correctly by getting the ip from /etc/hosts, which I was wrong.


So yes, host does not look in /etc/hosts by default.

Bob Proulx

unread,
Sep 6, 2014, 11:30:02 AM9/6/14
to
Podrigal, Aron wrote:
> ok, a fresh install of debian 7.6, here is my settings, I don't have
> libnss-myhostname
> installed yet

It shouldn't be *required*. It is one of those optional features that
some people want and others do not want. It is useful. But for
example I don't have it installed either. Because it creates an
emulation layer it can cause problems. The answer is, "It depends."

> root@test1:~# cat /etc/hosts
> 127.0.0.1 localhost
> 127.0.1.1 test1.test.com test1
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 localhost ip6-localhost ip6-loopback
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters

Hmm... You are actually the owner of test.com? Or did you just
double up using their domain? People often type in random domains
there thinking they can do that but really they shouldn't because
someone else owns that domain. If you own test.com then that is all
good. If you don't then you shouldn't use it.

> root@test1:~# getent hosts $(hostname)
> 127.0.1.1 test1.test.com test1

Good.

> root@test1:~# cat /etc/nsswitch.conf
> ...
> hosts: files dns

Good. Look for data from local files first. Fall through and ask DNS
for the name if not found locally.

That is what "normal" things will do. Normal things like "ping foo"
and "ssh foo" and http://foo/ and so forth. Not DNS specific things
such as host or dig.

> root@test1:~# host -v $(hostname)
> Trying "test1"
> Host test1 not found: 3(NXDOMAIN)
> Received 98 bytes from 8.8.8.8#53 in 14 ms

The host, dig and nslookup and those commands are DNS commands. As
Reco and Brian noted DNS is a network service and separate from the
local file configuration. Your local files are fine. When you try to
do a DNS lookup from your DNS nameserver it is failing to respond with
an appropriate localhost entry.

> Clearly, it skips /etc/hosts entries.

Right. That is what it is supposed to do. DNS doesn't use
/etc/hosts. DNS is a network service. The nsswitch is used to
indicate that normal system processes that use libc will look through
files first and then dns. But 'host' is a dns specific lookup. It by
design of being a dns lookup tool only looks in dns.

> After digging around, I noticed, that I had always setup DNS records for my
> hosts prior to doing the installations, which caused me the confusion on
> what was happening. I thought that the looking up my hostname resolves
> correctly by getting the ip from /etc/hosts, which I was wrong.
>
> So yes, host does not look in /etc/hosts by default.

That is correct.

But there is a problem. There is a problem with your network DNS
configuration. Every domain zone should have a localhost configured
for it. Therefore when you do a host lookup of localhost in DNS it
should return the zone's localhost record.

$ host localhost
localhost.proulx.com has address 127.0.0.1

That is because my proulx.com zone has a localhost record in it.

localhost IN A 127.0.0.1

If you are searching test.com for localhost.test.com then you should
be returning a record from that domain. Which is currently
misconfigured to be something other than 127.* so you shouldn't use it
either.

In summary, use your real domain name and not test.com. In your DNS
zone ensure you have a localhost record. If you squat on someone
else's domain then you are at the mercy of their configuration which
you don't want.

Bob
signature.asc

Brian

unread,
Sep 6, 2014, 12:20:02 PM9/6/14
to
On Sat 06 Sep 2014 at 09:25:44 -0600, Bob Proulx wrote:

> Podrigal, Aron wrote:
> > ok, a fresh install of debian 7.6, here is my settings, I don't have
> > libnss-myhostname
> > installed yet
>
> It shouldn't be *required*. It is one of those optional features that
> some people want and others do not want. It is useful. But for
> example I don't have it installed either. Because it creates an
> emulation layer it can cause problems. The answer is, "It depends."

Here's someone who wasn't singing the praises of libnss-myhostname
recently:

https://lists.debian.org/20140902145...@ypig.lip.ens-lyon.fr

exim takes its HELO/EHLO from canonical_hostname on the 127.0.1.1 line.
(I don't use postfix but think it does the same). This could cause
problems and, while most ISPs accept any old rubbish as a HELO/EHLO, it
was enough to put me of using libnss-myhostname.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/2014090616...@copernicus.demon.co.uk

Podrigal, Aron

unread,
Sep 6, 2014, 10:50:01 PM9/6/14
to

Just want to note here, that I bumped in to this whole problem while installing proxmox pve-cluster and pve-cluster did also ignore /etc/hosts.

Thanks guys for your help.

Jonathan Dowland

unread,
Sep 7, 2014, 2:30:03 PM9/7/14
to
On Fri, Sep 05, 2014 at 06:13:28PM -0400, Podrigal, Aron wrote:
> So yes, host does not look in /etc/hosts by default.

It never looks in /etc/hosts, as others have pointed out, host(1) only checks
DNS.

When a program wants to resolve a host, it does so using some system calls that
may or may not check DNS, and might check other things before or after DNS.
What is checked, and in what order, is defined in /etc/nsswitch.conf.

If you want to resolve a host and want to get the answer the system will give
you (irrespective of DNS), try

getent hosts some-hostname


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/2014090718...@bryant.redmars.org

Harry Putnam

unread,
Sep 11, 2014, 4:50:01 PM9/11/14
to
Reco <recov...@gmail.com> writes:

> Hi.
>
> On Thu, Sep 04, 2014 at 08:26:38PM -0400, Podrigal, Aron wrote:
>> Any idea what can be the cause? I am installing proxmox-ve and when
>> starting pve-cluster it fails with [main] crit: Unable to get local
>> IP address. So I tried
>> to look up with host utility and it does not resolve.
>>
>> host localhost
>> Host localhost not found: 3(NXDOMAIN)
>
> This is the way it should be - you DNS tells you that it knows nothing
> about localhost hostname (because host utility only does DNS requests).
> If you need to test the validity of /etc/hosts, you should use:
>
> getent hosts localhost
>
>
>> /etc/hosts
>> 127.0.0.1       localhost
>>
>>
>> in /etc/nsswitch.conf  I have
>> hosts:          files dns
>
> While this may look good, I believe you're missing a customary entry
> pointing to your hostname in /etc/hosts. I.e.
>
> <your_static_ip_here> <your_hostname_here>
>
> Reco

Not to derail the thread (hence the subject change) but being
something of a lamer about how all this works and seeing it carefully
laid out by Bob P. was very informative, as are Reco, Jonathan
... etc.

Though my question is a minor one it will probably require a quick
summary of my setup:

Debian (jessie)
Single user (really simple) setup on home lan. No trick stuff
going on.

This was close to a vanilla install. The only things that might be
considered a little unusual for such a simple setup was using the
exim4-heavy pkg (I wanted a small mail hub for the lan), and setting
up a webserver.

So cutting to the chase:
I'm a bit puzzled by what seems like a curious line in my
nsswitch.conf.

The `hosts' entry:

hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns

What does all that mean? I understand `files' first and `dns' at the
end but none of what is in between.

Further, I'm wondering if; where it says myhostname... it is supposed
to be edited with my actual host name?

Aside:
My lan is totally fictitious, right out of my pea brain 10.0.0.0/
and `hostname -f dv.local.lan'.

The 10.0.0.0/ is forced by comcasts new style modem/router/wifi
hardware that used that IP. It can all be changed, of course, but
would still be fictitious.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/87zje5nb...@reader.local.lan

Reco

unread,
Sep 11, 2014, 5:00:02 PM9/11/14
to
Hi.

On Thu, 11 Sep 2014 16:43:53 -0400
Harry Putnam <rea...@newsguy.com> wrote:
The `hosts' entry:
>
> hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns
>
> What does all that mean? I understand `files' first and `dns' at the
> end but none of what is in between.

Every hostname → IP resolving and every IP → hostname resolving goes
in the following order:

1) /etc/hosts

2) libnss-myhostname
I honestly don't know what scares me most about libnss-hostname - the
need of it in the first place, the author of the library, software that
behaves funny without it or the setups that genuinely need it :(

3) avahi-daemon
Uses funny IPs from 169.254.0.0/16 range and (in)famous .local domain.
Not needed if you have DNS in your LAN.

NOTFOUND=return belong to mdns4_minimal in this setup, and, according
to nsswitch.conf(5), means 'The lookup succeeded, but the requested
entry was not found'.

In this particular case it means 'regardless of result of queries to
resolve anything in .local domain - stop here, don't go further'.

4) Plain good old Domain Name Server, or several, according to
the /etc/resolv.conf (or its equivalent if resolvconf is used).


> Further, I'm wondering if; where it says myhostname... it is supposed
> to be edited with my actual host name?

No, please read the output of 'apt-cache show libnss-myhostname'. It'll
explain this 'myhostname' thing to you better that I can.


Reco


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140912005927.7a74...@gmail.com

Brian

unread,
Sep 11, 2014, 6:10:01 PM9/11/14
to
On Fri 12 Sep 2014 at 00:59:27 +0400, Reco wrote:

> 2) libnss-myhostname
> I honestly don't know what scares me most about libnss-hostname - the
> need of it in the first place, the author of the library, software that
> behaves funny without it or the setups that genuinely need it :(

People are usually frightened most by things they have no understanding
of.

If the local hostname is always resolvable by a 127.0.1.1 line in
/etc/hosts or the machine is unlikely to dynamically change its hostname
libnss-myhostname probably can be purged.

> 3) avahi-daemon
> Uses funny IPs from 169.254.0.0/16 range and (in)famous .local domain.
> Not needed if you have DNS in your LAN.

Needed with cups to discover and advertise print queues on a network.

> No, please read the output of 'apt-cache show libnss-myhostname'. It'll
> explain this 'myhostname' thing to you better that I can.

That wouldn't be hard.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/2014091122...@copernicus.demon.co.uk

Reco

unread,
Sep 11, 2014, 10:40:01 PM9/11/14
to
On Thu, 11 Sep 2014 23:03:25 +0100
Brian <ad...@cityscape.co.uk> wrote:

> On Fri 12 Sep 2014 at 00:59:27 +0400, Reco wrote:
>
> > 2) libnss-myhostname
> > I honestly don't know what scares me most about libnss-hostname - the
> > need of it in the first place, the author of the library, software that
> > behaves funny without it or the setups that genuinely need it :(
>
> People are usually frightened most by things they have no understanding
> of.
>
> If the local hostname is always resolvable by a 127.0.1.1 line in
> /etc/hosts or the machine is unlikely to dynamically change its hostname
> libnss-myhostname probably can be purged.

'Purged' implies one installed libnss-myhostname in the first place.
And libnss-myhostname does more than merely match a local hostname to
127.0.1.1. For example, it 'helpfully' mathes FQDN hostname with
127.0.1.1, and also does the same for ipv6.

But the most interesting is why there's a need for the whole library to
do the job if a couple of lines in /etc/hosts would do the job just
fine.

>
> > 3) avahi-daemon
> > Uses funny IPs from 169.254.0.0/16 range and (in)famous .local domain.
> > Not needed if you have DNS in your LAN.
>
> Needed with cups to discover and advertise print queues on a network.

According to the cupsd.conf, DNSSD is only one of the methods of
printer discovery. And, as I can tell from the experience, cupsd can
perfectly discover any network printer without it if asked to do so.
'Advertise' is a gimmick too. If one needs to let know others where
to print - one uses dhcp option 9. Therefore 'needed' is a wrong term.

Reco


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140912063458.32e7...@gmail.com

Brian

unread,
Sep 12, 2014, 6:30:01 AM9/12/14
to
On Fri 12 Sep 2014 at 06:34:58 +0400, Reco wrote:

> On Thu, 11 Sep 2014 23:03:25 +0100
> Brian <ad...@cityscape.co.uk> wrote:
> >
> > If the local hostname is always resolvable by a 127.0.1.1 line in
> > /etc/hosts or the machine is unlikely to dynamically change its hostname
> > libnss-myhostname probably can be purged.
>
> 'Purged' implies one installed libnss-myhostname in the first place.
> And libnss-myhostname does more than merely match a local hostname to
> 127.0.1.1. For example, it 'helpfully' mathes FQDN hostname with
> 127.0.1.1, and also does the same for ipv6.
>
> But the most interesting is why there's a need for the whole library to
> do the job if a couple of lines in /etc/hosts would do the job just
> fine.

A few posts back in this thread there is

https://lists.debian.org/2014090616...@copernicus.demon.co.uk

The link it contains leads to another with a recent -devel discussion.
There is a 10 year history with the issue; a search with "/etc/hosts"
and "Thomas Hood" should bring up some of it.

> > Needed with cups to discover and advertise print queues on a network.
>
> According to the cupsd.conf, DNSSD is only one of the methods of
> printer discovery. And, as I can tell from the experience, cupsd can
> perfectly discover any network printer without it if asked to do so.
> 'Advertise' is a gimmick too. If one needs to let know others where
> to print - one uses dhcp option 9. Therefore 'needed' is a wrong term.

DNSSD is the *only* method for printer discovery with cups-daemon in
Jessie.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/2014091210...@copernicus.demon.co.uk

Reco

unread,
Sep 12, 2014, 2:30:02 PM9/12/14
to
Hi.

On Fri, 12 Sep 2014 11:23:56 +0100
Brian <ad...@cityscape.co.uk> wrote:

> > 'Purged' implies one installed libnss-myhostname in the first place.
> > And libnss-myhostname does more than merely match a local hostname to
> > 127.0.1.1. For example, it 'helpfully' mathes FQDN hostname with
> > 127.0.1.1, and also does the same for ipv6.
> >
> > But the most interesting is why there's a need for the whole library to
> > do the job if a couple of lines in /etc/hosts would do the job just
> > fine.
>
> A few posts back in this thread there is
>
> https://lists.debian.org/2014090616...@copernicus.demon.co.uk
>
> The link it contains leads to another with a recent -devel discussion.
> There is a 10 year history with the issue; a search with "/etc/hosts"
> and "Thomas Hood" should bring up some of it.

I assume you're referring to:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247734

An interesting reading, thanks, but it looks on the problem from
somewhat different angle that I do. What I meant was:

If one as perfectly valid (which seem to be a direct consequence of
#247734) /etc/hosts with the following values:

127.0.0.1 localhost
127.0.1.1 <fqdn> <hostname>

Why would one need libnss-myhostname in Debian? Especially if Debian
Installer generates such /etc/hosts for the last 10 years give or take?

I acknowledge that there're other distributions than Debian, and they
used to do things differently (for example, comment 125 of #247734
implies that RedHat did not generate such /etc/hosts back then), so to
address those other distributions' problem libnss-myhostname was
created.

But using this library in Debian seem to be redundant at best.


> > > Needed with cups to discover and advertise print queues on a network.
> >
> > According to the cupsd.conf, DNSSD is only one of the methods of
> > printer discovery. And, as I can tell from the experience, cupsd can
> > perfectly discover any network printer without it if asked to do so.
> > 'Advertise' is a gimmick too. If one needs to let know others where
> > to print - one uses dhcp option 9. Therefore 'needed' is a wrong term.
>
> DNSSD is the *only* method for printer discovery with cups-daemon in
> Jessie.

Oh, that changes things somewhat as I didn't know that. May need to
research the motivation of CUPS upstream for this step. I take it that
my other arguments don't meet any objection from your side?

Reco


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140912222922.95ee...@gmail.com

Joe

unread,
Sep 12, 2014, 3:30:02 PM9/12/14
to
On Fri, 12 Sep 2014 22:29:22 +0400
Reco <recov...@gmail.com> wrote:


>
> If one as perfectly valid (which seem to be a direct consequence of
> #247734) /etc/hosts with the following values:
>
> 127.0.0.1 localhost
> 127.0.1.1 <fqdn> <hostname>
>

Just to throw another log on the fire: I recently acquired a Windows 8
laptop (don't ask) and found it wouldn't pick up a DHCP address on my
network, which includes a Windows 7 desktop and a few Linux machines.

It took me some effort to get it to connect with manual values as
hands-on networking is quite difficult in Windows these days (and who
thought APIPA addresses were a good idea? That is the one way to
absolutely guarantee that a computer can't connect to any network).

With a bit of packet capturing, it appeared that isc-dhcp-server on
Wheezy was sometimes using 127.0.1.1 as a source address during DHCP
negotiation, which Windows 8 (rightly in my opinion) took exception to.

So I lost the 127.0.1.1 entry, without any obvious problems. I saw a
while back in the thread that exim4 may use it, but my exim4 has been
very firmly told what FQDN to use, and it isn't the server's.

--
Joe


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140912202...@jresid.jretrading.com

Brian

unread,
Sep 12, 2014, 6:00:03 PM9/12/14
to
On Fri 12 Sep 2014 at 22:29:22 +0400, Reco wrote:

> On Fri, 12 Sep 2014 11:23:56 +0100
> Brian <ad...@cityscape.co.uk> wrote:
>
> > > But the most interesting is why there's a need for the whole library to
> > > do the job if a couple of lines in /etc/hosts would do the job just
> > > fine.
> >
> > A few posts back in this thread there is
> >
> > https://lists.debian.org/2014090616...@copernicus.demon.co.uk
> >
> > The link it contains leads to another with a recent -devel discussion.
> > There is a 10 year history with the issue; a search with "/etc/hosts"
> > and "Thomas Hood" should bring up some of it.
>
> I assume you're referring to:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=247734
>
> An interesting reading, thanks, but it looks on the problem from
> somewhat different angle that I do. What I meant was:
>
> If one as perfectly valid (which seem to be a direct consequence of
> #247734) /etc/hosts with the following values:
>
> 127.0.0.1 localhost
> 127.0.1.1 <fqdn> <hostname>

I would tend to agree with this, if only because exim uses <fqdn> for a
HELO/EHLO and it would require some thought to fit it into a framework
using libnss-myhostname. It took long enough for us to get to something
which worked reliably so my motivation for changing isn't great.

For the moment libnss-myhostname on Jessie has only 3 rdepends (2 are
Recommends:), but there has been talk of d-i installing it by default.
That might see a change to the d-i generated /etc/hosts.

> Why would one need libnss-myhostname in Debian? Especially if Debian
> Installer generates such /etc/hosts for the last 10 years give or take?
>
> I acknowledge that there're other distributions than Debian, and they
> used to do things differently (for example, comment 125 of #247734
> implies that RedHat did not generate such /etc/hosts back then), so to
> address those other distributions' problem libnss-myhostname was
> created.
>
> But using this library in Debian seem to be redundant at best.

I think its ability to accomodate dynamic changes in the hostname is
seen as an advantage. Never having experienced that, I'm unable to
comment further.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/2014091221...@copernicus.demon.co.uk

Brian

unread,
Sep 12, 2014, 6:00:03 PM9/12/14
to
On Fri 12 Sep 2014 at 22:29:22 +0400, Reco wrote:

If you are referring to "dhcp option 9" I'm afraid I didn't spend very
long looking at that because there wasn't anything which made me sit up
and take notice; I'm prepared to acknowledge I might have missed
something. Howvever, my focus is on how the printing system actually
works in Debian and not on replacing the role of avahi.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/2014091221...@copernicus.demon.co.uk

Vincent Lefevre

unread,
Sep 16, 2014, 4:40:01 AM9/16/14
to
On 2014-09-12 00:59:27 +0400, Reco wrote:
> On Thu, 11 Sep 2014 16:43:53 -0400
> Harry Putnam <rea...@newsguy.com> wrote:
> The `hosts' entry:
> >
> > hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns
> >
> > What does all that mean? I understand `files' first and `dns' at the
> > end but none of what is in between.
>
> Every hostname → IP resolving and every IP → hostname resolving goes
> in the following order:
>
> 1) /etc/hosts
>
> 2) libnss-myhostname
> I honestly don't know what scares me most about libnss-hostname - the
> need of it in the first place, the author of the library, software that
> behaves funny without it or the setups that genuinely need it :(
[...]

But warning! You can have IPv4 resolving or IPv6 resolving.
Some software (e.g. exim) does IPv6 resolving first. Since
libnss-myhostname sets up IPv6 resolving for the local hostname,
which is usually not done in /etc/hosts (at least by default),
settings done by libnss-myhostname come first in this case, so
that libnss-myhostname can break things:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756224#114

libnss-myhostname should not be used (at least currently) when
the user has a /etc/hosts file.

--
Vincent Lefèvre <vin...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140916082...@xvii.vinc17.org

Vincent Lefevre

unread,
Sep 16, 2014, 4:40:01 AM9/16/14
to
On 2014-09-12 06:34:58 +0400, Reco wrote:
> On Thu, 11 Sep 2014 23:03:25 +0100
> Brian <ad...@cityscape.co.uk> wrote:
> > If the local hostname is always resolvable by a 127.0.1.1 line in
> > /etc/hosts or the machine is unlikely to dynamically change its
> > hostname libnss-myhostname probably can be purged.
>
> 'Purged' implies one installed libnss-myhostname in the first place.

It can be installed by a dependency (e.g. due to some GNOME package).

> And libnss-myhostname does more than merely match a local hostname to
> 127.0.1.1. For example, it 'helpfully' mathes FQDN hostname with
> 127.0.1.1, and also does the same for ipv6.

This is what it should do ideally. Unfortunately, for some users,
it doesn't take the FQDN, but just the short hostname:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756224

--
Vincent Lef�vre <vin...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: https://lists.debian.org/20140916083...@xvii.vinc17.org
0 new messages