NetBSD Problem Report #55799

From www@netbsd.org  Mon Nov  9 12:01:02 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C54451A9246
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  9 Nov 2020 12:01:01 +0000 (UTC)
Message-Id: <20201109120100.CAE991A9256@mollari.NetBSD.org>
Date: Mon,  9 Nov 2020 12:01:00 +0000 (UTC)
From: 20.100@defert.com
Reply-To: 20.100@defert.com
To: gnats-bugs@NetBSD.org
Subject: nsswitch.conf(5) man page 
X-Send-Pr-Version: www-1.0

>Number:         55799
>Category:       bin
>Synopsis:       nsswitch.conf(5) man page
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 09 12:05:00 +0000 2020
>Last-Modified:  Mon Nov 09 15:15:01 +0000 2020
>Originator:     Vincent DEFERT
>Release:        9.99.75
>Organization:
>Environment:
NetBSD nuc6 9.99.75 NetBSD 9.99.75 (GENERIC_KASLR) #0: Wed Nov  4 09:15:10 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC_KASLR amd64
>Description:
The nsswitch.conf(5) man page incorrectly specifies:

mdnsd            Use mdnsd(8) for “hosts” lookups

instead of:

mdns             Use mdnsd(8) for “hosts” lookups
>How-To-Repeat:
Modify /etc/nsswitch.conf as follows:

hosts:          files mdnsd dns

Then ping www.netbsd.org => ping does not respond for a long time.
Then ping a machine on your local network => same delay (if your router acts as a DNS server) or error (otherwise).
>Fix:
Modify /etc/nsswitch.conf as follows:

hosts:          files mdns dns

Then ping www.netbsd.org => ping responds instantly.
Then ping a machine on your local network => ping also responds instantly.

>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/55799: nsswitch.conf(5) man page 
Date: Mon, 9 Nov 2020 15:02:40 -0000 (UTC)

 20.100@defert.com writes:

 >The nsswitch.conf(5) man page incorrectly specifies:
 >mdnsd            Use mdnsd(8) for “hosts” lookups
 >instead of:
 >mdns             Use mdnsd(8) for “hosts” lookups

 The source is used to load the corresponding NSS shared library.

 mdnsd          -> nss_mdnsd.so
 multicast_dns  -> nss_multicast_dns.so

 There is none for 'mdns' and since it doesn't reference a builtin source
 it is skipped.

 >Modify /etc/nsswitch.conf as follows:
 >hosts:          files mdnsd dns
 >Then ping www.netbsd.org => ping does not respond for a long time.
 >Then ping a machine on your local network => same delay (if your router acts as a DNS server) or error (otherwise).

 The nss_mdnsd module will try to contact a locally running mdnsd. Eventually
 it times out and dns is used.

 You need to start mdnsd. And then you would use something like 'files mdnsd'
 or 'files multicast_dns dns' in nsswitch.conf.

 >hosts:          files mdns dns

 >Then ping www.netbsd.org => ping responds instantly.
 >Then ping a machine on your local network => ping also responds instantly.

 In both cases, you only use dns. The libc code doesn't print warnings
 when it doesn't find a module as builtin sources don't have a module
 and would also generate warnings in this place.

 		if (snprintf(buf, sizeof(buf), "nss_%s.so.%d", mod.name,
 		    NSS_MODULE_INTERFACE_VERSION) >= (int)sizeof(buf))
 			goto out;
 		mod.handle = dlopen(buf, RTLD_LOCAL | RTLD_LAZY);
 		if (mod.handle == NULL) {
 #ifdef _NSS_DEBUG
 			/*
 			 * This gets pretty annoying, since the built-in
 			 * sources are not yet modules.
 			 */
 			/* XXX log some error? */
 #endif
 			goto out;
 		}


 Greetings,
 -- 
 -- 
                                 Michael van Elst
 Internet: mlelstv@serpens.de
                                 "A potential Snark may lurk in every tree."

From: Vincent DEFERT <20.100@defert.com>
To: gnats-bugs@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: bin/55799: nsswitch.conf(5) man page
Date: Mon, 9 Nov 2020 16:14:08 +0100

 This is a multi-part message in MIME format.
 --------------27C2694BE57C6D01973129D1
 Content-Type: text/plain; charset=utf-8; format=flowed
 Content-Transfer-Encoding: 8bit

 You're right! It didn't work just because the .local suffix is required 
 but not automatically added to host names when calling mdnsd.
 If I set "domain local" in /etc/resolv.conf, it works as documented.
 Thanks for the clarification.

 On 09/11/2020 16:05, Michael van Elst wrote:
 > The following reply was made to PR bin/55799; it has been noted by GNATS.
 >
 > From: mlelstv@serpens.de (Michael van Elst)
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: bin/55799: nsswitch.conf(5) man page
 > Date: Mon, 9 Nov 2020 15:02:40 -0000 (UTC)
 >
 >   20.100@defert.com writes:
 >   
 >   >The nsswitch.conf(5) man page incorrectly specifies:
 >   >mdnsd            Use mdnsd(8) for “hosts” lookups
 >   >instead of:
 >   >mdns             Use mdnsd(8) for “hosts” lookups
 >   
 >   The source is used to load the corresponding NSS shared library.
 >   
 >   mdnsd          -> nss_mdnsd.so
 >   multicast_dns  -> nss_multicast_dns.so
 >   
 >   There is none for 'mdns' and since it doesn't reference a builtin source
 >   it is skipped.
 >   
 >   >Modify /etc/nsswitch.conf as follows:
 >   >hosts:          files mdnsd dns
 >   >Then ping www.netbsd.org => ping does not respond for a long time.
 >   >Then ping a machine on your local network => same delay (if your router acts as a DNS server) or error (otherwise).
 >   
 >   The nss_mdnsd module will try to contact a locally running mdnsd. Eventually
 >   it times out and dns is used.
 >   
 >   You need to start mdnsd. And then you would use something like 'files mdnsd'
 >   or 'files multicast_dns dns' in nsswitch.conf.
 >   
 >   >hosts:          files mdns dns
 >   
 >   >Then ping www.netbsd.org => ping responds instantly.
 >   >Then ping a machine on your local network => ping also responds instantly.
 >   
 >   In both cases, you only use dns. The libc code doesn't print warnings
 >   when it doesn't find a module as builtin sources don't have a module
 >   and would also generate warnings in this place.
 >   
 >   		if (snprintf(buf, sizeof(buf), "nss_%s.so.%d", mod.name,
 >   		    NSS_MODULE_INTERFACE_VERSION) >= (int)sizeof(buf))
 >   			goto out;
 >   		mod.handle = dlopen(buf, RTLD_LOCAL | RTLD_LAZY);
 >   		if (mod.handle == NULL) {
 >   #ifdef _NSS_DEBUG
 >   			/*
 >   			 * This gets pretty annoying, since the built-in
 >   			 * sources are not yet modules.
 >   			 */
 >   			/* XXX log some error? */
 >   #endif
 >   			goto out;
 >   		}
 >   
 >   
 >   Greetings,
 >   --
 >   --
 >                                   Michael van Elst
 >   Internet: mlelstv@serpens.de
 >                                   "A potential Snark may lurk in every tree."
 >   


 --------------27C2694BE57C6D01973129D1
 Content-Type: text/html; charset=utf-8
 Content-Transfer-Encoding: 8bit

 <html>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   </head>
   <body>
     <font face="DejaVu Sans">You're right! It didn't work just because
       the .local suffix is required but not automatically added to host
       names when calling mdnsd.<br>
       If I set "domain local" in /etc/resolv.conf, it works as
       documented.<br>
       Thanks for the clarification. </font><br>
     <br>
     <div class="moz-cite-prefix">On 09/11/2020 16:05, Michael van Elst
       wrote:<br>
     </div>
     <blockquote type="cite"
       cite="mid:20201109150501.896581A9256@mollari.NetBSD.org">
       <pre class="moz-quote-pre" wrap="">The following reply was made to PR bin/55799; it has been noted by GNATS.

 From: <a class="moz-txt-link-abbreviated" href="mailto:mlelstv@serpens.de">mlelstv@serpens.de</a> (Michael van Elst)
 To: <a class="moz-txt-link-abbreviated" href="mailto:gnats-bugs@netbsd.org">gnats-bugs@netbsd.org</a>
 Cc: 
 Subject: Re: bin/55799: nsswitch.conf(5) man page 
 Date: Mon, 9 Nov 2020 15:02:40 -0000 (UTC)

  <a class="moz-txt-link-abbreviated" href="mailto:20.100@defert.com">20.100@defert.com</a> writes:

  &gt;The nsswitch.conf(5) man page incorrectly specifies:
  &gt;mdnsd            Use mdnsd(8) for “hosts” lookups
  &gt;instead of:
  &gt;mdns             Use mdnsd(8) for “hosts” lookups

  The source is used to load the corresponding NSS shared library.

  mdnsd          -&gt; nss_mdnsd.so
  multicast_dns  -&gt; nss_multicast_dns.so

  There is none for 'mdns' and since it doesn't reference a builtin source
  it is skipped.

  &gt;Modify /etc/nsswitch.conf as follows:
  &gt;hosts:          files mdnsd dns
  &gt;Then ping <a class="moz-txt-link-abbreviated" href="http://www.netbsd.org">www.netbsd.org</a> =&gt; ping does not respond for a long time.
  &gt;Then ping a machine on your local network =&gt; same delay (if your router acts as a DNS server) or error (otherwise).

  The nss_mdnsd module will try to contact a locally running mdnsd. Eventually
  it times out and dns is used.

  You need to start mdnsd. And then you would use something like 'files mdnsd'
  or 'files multicast_dns dns' in nsswitch.conf.

  &gt;hosts:          files mdns dns

  &gt;Then ping <a class="moz-txt-link-abbreviated" href="http://www.netbsd.org">www.netbsd.org</a> =&gt; ping responds instantly.
  &gt;Then ping a machine on your local network =&gt; ping also responds instantly.

  In both cases, you only use dns. The libc code doesn't print warnings
  when it doesn't find a module as builtin sources don't have a module
  and would also generate warnings in this place.

  		if (snprintf(buf, sizeof(buf), "nss_%s.so.%d", mod.name,
  		    NSS_MODULE_INTERFACE_VERSION) &gt;= (int)sizeof(buf))
  			goto out;
  		mod.handle = dlopen(buf, RTLD_LOCAL | RTLD_LAZY);
  		if (mod.handle == NULL) {
  #ifdef _NSS_DEBUG
  			/*
  			 * This gets pretty annoying, since the built-in
  			 * sources are not yet modules.
  			 */
  			/* XXX log some error? */
  #endif
  			goto out;
  		}


  Greetings,
  -- 
  -- 
                                  Michael van Elst
  Internet: <a class="moz-txt-link-abbreviated" href="mailto:mlelstv@serpens.de">mlelstv@serpens.de</a>
                                  "A potential Snark may lurk in every tree."

 </pre>
     </blockquote>
     <br>
   </body>
 </html>

 --------------27C2694BE57C6D01973129D1--

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.