public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Name resolution of dot terminated hostnames
@ 2019-05-24 18:53 Etienne Buira
  2019-05-24 19:20 ` Florian Weimer
  2019-05-24 20:47 ` Jeffrey Walton
  0 siblings, 2 replies; 6+ messages in thread
From: Etienne Buira @ 2019-05-24 18:53 UTC (permalink / raw)
  To: libc-help

Hi,

On a Gentoo box (with Gentoo packaged glibc 2.29-r2), libc was unable to
resolve 'localhost.' (with the trailing dot), although it can resolve
'localhost', and conf looks fine.

With older libcs, (at least 2.28 based), libc can resolve the dot
terminated hostname just fine.

I could not find any precision in libc's doc about this.

hostname(7) man page reads 'If the input name ends with a trailing dot,
the trailing dot is removed, and the remaining name is looked up with no
further processing.'

I do not have any vanilla libc at hand, nor any libc development
environment, but i might set up one if a bugreport is needed.

Questions are: can a vanilla user or dev test and report resolution of
'localhost.'?
Is there any intentional change i missed about name resolution?

Regards.

PS: I'm not subscribed to the list, so please CC me.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Name resolution of dot terminated hostnames
  2019-05-24 18:53 Name resolution of dot terminated hostnames Etienne Buira
@ 2019-05-24 19:20 ` Florian Weimer
  2019-05-24 20:36   ` Etienne Buira
  2019-05-24 20:47 ` Jeffrey Walton
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2019-05-24 19:20 UTC (permalink / raw)
  To: Etienne Buira; +Cc: libc-help

* Etienne Buira:

> On a Gentoo box (with Gentoo packaged glibc 2.29-r2), libc was unable to
> resolve 'localhost.' (with the trailing dot), although it can resolve
> 'localhost', and conf looks fine.
>
> With older libcs, (at least 2.28 based), libc can resolve the dot
> terminated hostname just fine.

What's your /etc/nsswitch.conf file?  What's in /etc/hosts?

> hostname(7) man page reads 'If the input name ends with a trailing dot,
> the trailing dot is removed, and the remaining name is looked up with no
> further processing.'

This covers DNS processing (“Internet name resolver”) only.  A newer
version of the manpage should reflect that more

Thanks,
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Name resolution of dot terminated hostnames
  2019-05-24 19:20 ` Florian Weimer
@ 2019-05-24 20:36   ` Etienne Buira
  2019-05-24 21:11     ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: Etienne Buira @ 2019-05-24 20:36 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Etienne Buira, libc-help

On Fri, May 24, 2019 at 09:20:23PM +0200, Florian Weimer wrote:
> * Etienne Buira:
> 
> > On a Gentoo box (with Gentoo packaged glibc 2.29-r2), libc was unable to
> > resolve 'localhost.' (with the trailing dot), although it can resolve
> > 'localhost', and conf looks fine.
> >
> > With older libcs, (at least 2.28 based), libc can resolve the dot
> > terminated hostname just fine.
> 
> What's your /etc/nsswitch.conf file?  What's in /etc/hosts?

In nsswitch.conf, the only line regarding hosts is:
hosts: file dns

In hosts, the only non-comment line is:
127.0.0.1 localhost

Some nameservers are set in resolv.conf, but the box didn't send any dns
query.

The same conf with the older libc versions are resolving dotted form.

> > hostname(7) man page reads 'If the input name ends with a trailing dot,
> > the trailing dot is removed, and the remaining name is looked up with no
> > further processing.'
> 
> This covers DNS processing (“Internet name resolver”) only.  A newer
> version of the manpage should reflect that more

Manpage took from the Linux man-pages project 5.01, currently online. But
reading it again, it is clear it is about DNS-based name resolver. Are
you aware of any normative reference about this dotted form of names
which are not part of a dns hierarchy?

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Name resolution of dot terminated hostnames
  2019-05-24 18:53 Name resolution of dot terminated hostnames Etienne Buira
  2019-05-24 19:20 ` Florian Weimer
@ 2019-05-24 20:47 ` Jeffrey Walton
  1 sibling, 0 replies; 6+ messages in thread
From: Jeffrey Walton @ 2019-05-24 20:47 UTC (permalink / raw)
  To: Etienne Buira; +Cc: libc-help

On Fri, May 24, 2019 at 2:53 PM Etienne Buira <etienne.buira@free.fr> wrote:
>
> On a Gentoo box (with Gentoo packaged glibc 2.29-r2), libc was unable to
> resolve 'localhost.' (with the trailing dot), although it can resolve
> 'localhost', and conf looks fine.

The trailing dot indicates your are at the top of the DNS tree. It is
a fully qualified domain name (FQDN). Domain suffix search paths
should not be used with a FQDN.

Jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Name resolution of dot terminated hostnames
  2019-05-24 20:36   ` Etienne Buira
@ 2019-05-24 21:11     ` Florian Weimer
  2019-05-25  6:39       ` Etienne Buira
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2019-05-24 21:11 UTC (permalink / raw)
  To: Etienne Buira; +Cc: libc-help

* Etienne Buira:

> On Fri, May 24, 2019 at 09:20:23PM +0200, Florian Weimer wrote:
>> * Etienne Buira:
>> 
>> > On a Gentoo box (with Gentoo packaged glibc 2.29-r2), libc was unable to
>> > resolve 'localhost.' (with the trailing dot), although it can resolve
>> > 'localhost', and conf looks fine.
>> >
>> > With older libcs, (at least 2.28 based), libc can resolve the dot
>> > terminated hostname just fine.
>> 
>> What's your /etc/nsswitch.conf file?  What's in /etc/hosts?
>
> In nsswitch.conf, the only line regarding hosts is:
> hosts: file dns

Presumably this?

hosts: files dns

> In hosts, the only non-comment line is:
> 127.0.0.1 localhost
>
> Some nameservers are set in resolv.conf, but the box didn't send any dns
> query.

That's odd.  I think localhost. queries would have always gone out over
DNS unless localhost. (with the trailing dot) is listed in /etc/hosts.
We made quite a few changes to the hosts implementation of nss_files in
the recent times, but I don't remember removing the trailing-dot
stripping.  It's always been a straight strcasecmp (which is arguably
wrong for several reasons).

> The same conf with the older libc versions are resolving dotted form.

With or without DNS queries?

>> > hostname(7) man page reads 'If the input name ends with a trailing dot,
>> > the trailing dot is removed, and the remaining name is looked up with no
>> > further processing.'
>> 
>> This covers DNS processing (“Internet name resolver”) only.  A newer
>> version of the manpage should reflect that more
>
> Manpage took from the Linux man-pages project 5.01, currently online. But
> reading it again, it is clear it is about DNS-based name resolver. Are
> you aware of any normative reference about this dotted form of names
> which are not part of a dns hierarchy?

There is RFC 6761 for special-use names.  The trailing dot is mentioned
in RFC 3986.  The behavior regarding trailing dots is varied; one major
DNS implementation suppressed search list processing with the trailing
dot, but had a single cache entry for domain with and without the
trailing dot.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Name resolution of dot terminated hostnames
  2019-05-24 21:11     ` Florian Weimer
@ 2019-05-25  6:39       ` Etienne Buira
  0 siblings, 0 replies; 6+ messages in thread
From: Etienne Buira @ 2019-05-25  6:39 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Etienne Buira, libc-help

On Fri, May 24, 2019 at 11:11:37PM +0200, Florian Weimer wrote:
> * Etienne Buira:
> 
> > On Fri, May 24, 2019 at 09:20:23PM +0200, Florian Weimer wrote:
> >> What's your /etc/nsswitch.conf file?  What's in /etc/hosts?
> >
> > In nsswitch.conf, the only line regarding hosts is:
> > hosts: file dns
> 
> Presumably this?
> 
> hosts: files dns

Indeed.

> > In hosts, the only non-comment line is:
> > 127.0.0.1 localhost
> >
> > Some nameservers are set in resolv.conf, but the box didn't send any dns
> > query.
> 
> That's odd.  I think localhost. queries would have always gone out over
> DNS unless localhost. (with the trailing dot) is listed in /etc/hosts.
> We made quite a few changes to the hosts implementation of nss_files in
> the recent times, but I don't remember removing the trailing-dot
> stripping.  It's always been a straight strcasecmp (which is arguably
> wrong for several reasons).
> 
> > The same conf with the older libc versions are resolving dotted form.
> 
> With or without DNS queries?

OK, understood what happened, boxes resolving this did so using DNS
(biten by leniency), box that didn't resolve could not send any dns
query because of exotic ip config. Sorry for the noise.

> > Manpage took from the Linux man-pages project 5.01, currently online. But
> > reading it again, it is clear it is about DNS-based name resolver. Are
> > you aware of any normative reference about this dotted form of names
> > which are not part of a dns hierarchy?
> 
> There is RFC 6761 for special-use names.  The trailing dot is mentioned
> in RFC 3986.  The behavior regarding trailing dots is varied; one major
> DNS implementation suppressed search list processing with the trailing
> dot, but had a single cache entry for domain with and without the
> trailing dot.

Thank you very much.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-25  6:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24 18:53 Name resolution of dot terminated hostnames Etienne Buira
2019-05-24 19:20 ` Florian Weimer
2019-05-24 20:36   ` Etienne Buira
2019-05-24 21:11     ` Florian Weimer
2019-05-25  6:39       ` Etienne Buira
2019-05-24 20:47 ` Jeffrey Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).