Name resolution of dot terminated hostnames

Etienne Buira etienne.buira@free.fr
Fri May 24 20:36:00 GMT 2019


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.



More information about the Libc-help mailing list