public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nss/28700] New: "dns [!UNAVAIL=return] files" default for hosts database is not useful
@ 2021-12-15 18:03 fweimer at redhat dot com
  2021-12-15 18:04 ` [Bug nss/28700] " fweimer at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2021-12-15 18:03 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28700

            Bug ID: 28700
           Summary: "dns [!UNAVAIL=return] files" default for hosts
                    database is not useful
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nss
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---

It is common to add localhost to /etc/hosts because the name does not exist in
the DNS, but is commonly used as a host name.

With the built-in "dns [!UNAVAIL=return] files" default, dns is searched first
and provides an answer for "localhost" (NXDOMAIN). We never look at the files
database as a result, so the contents of /etc/hosts is ignored.

This means that the built-in hosts database default is not very useful, it
should be "files dns", which is what most distributions use in their
/etc/nsswitch.conf files.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug nss/28700] "dns [!UNAVAIL=return] files" default for hosts database is not useful
  2021-12-15 18:03 [Bug nss/28700] New: "dns [!UNAVAIL=return] files" default for hosts database is not useful fweimer at redhat dot com
@ 2021-12-15 18:04 ` fweimer at redhat dot com
  2021-12-15 18:34 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2021-12-15 18:04 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28700

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com
                 CC|                            |fweimer at redhat dot com
             Status|NEW                         |ASSIGNED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug nss/28700] "dns [!UNAVAIL=return] files" default for hosts database is not useful
  2021-12-15 18:03 [Bug nss/28700] New: "dns [!UNAVAIL=return] files" default for hosts database is not useful fweimer at redhat dot com
  2021-12-15 18:04 ` [Bug nss/28700] " fweimer at redhat dot com
@ 2021-12-15 18:34 ` fweimer at redhat dot com
  2021-12-15 19:31 ` fweimer at redhat dot com
  2021-12-17 11:12 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2021-12-15 18:34 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28700

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Patch posted:

[PATCH] nss: Use "files dns" as the default for the hosts database (bug 28700)
https://sourceware.org/pipermail/libc-alpha/2021-December/134207.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug nss/28700] "dns [!UNAVAIL=return] files" default for hosts database is not useful
  2021-12-15 18:03 [Bug nss/28700] New: "dns [!UNAVAIL=return] files" default for hosts database is not useful fweimer at redhat dot com
  2021-12-15 18:04 ` [Bug nss/28700] " fweimer at redhat dot com
  2021-12-15 18:34 ` fweimer at redhat dot com
@ 2021-12-15 19:31 ` fweimer at redhat dot com
  2021-12-17 11:12 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2021-12-15 19:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28700

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=2033020

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug nss/28700] "dns [!UNAVAIL=return] files" default for hosts database is not useful
  2021-12-15 18:03 [Bug nss/28700] New: "dns [!UNAVAIL=return] files" default for hosts database is not useful fweimer at redhat dot com
                   ` (2 preceding siblings ...)
  2021-12-15 19:31 ` fweimer at redhat dot com
@ 2021-12-17 11:12 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2021-12-17 11:12 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28700

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.35
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for glibc 2.35 via:

commit b99b0f93ee8762fe53ff65802deb6f00700b9924
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Dec 17 12:01:20 2021 +0100

    nss: Use "files dns" as the default for the hosts database (bug 28700)

    This matches what is currently in nss/nsswitch.conf.  The new ordering
    matches what most distributions use in their installed configuration
    files.

    It is common to add localhost to /etc/hosts because the name does not
    exist in the DNS, but is commonly used as a host name.

    With the built-in "dns [!UNAVAIL=return] files" default, dns is
    searched first and provides an answer for "localhost" (NXDOMAIN).
    We never look at the files database as a result, so the contents of
    /etc/hosts is ignored.  This means that "getent hosts localhost"
    fail without a /etc/nsswitch.conf file, even though the host name
    is listed in /etc/hosts.

    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-12-17 11:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 18:03 [Bug nss/28700] New: "dns [!UNAVAIL=return] files" default for hosts database is not useful fweimer at redhat dot com
2021-12-15 18:04 ` [Bug nss/28700] " fweimer at redhat dot com
2021-12-15 18:34 ` fweimer at redhat dot com
2021-12-15 19:31 ` fweimer at redhat dot com
2021-12-17 11:12 ` fweimer at redhat dot com

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).