NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/55799: nsswitch.conf(5) man page



The following reply was made to PR bin/55799; it has been noted by GNATS.

From: Vincent DEFERT <20.100%defert.com@localhost>
To: gnats-bugs%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
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@localhost (Michael van Elst)
 > To: gnats-bugs%netbsd.org@localhost
 > Cc:
 > Subject: Re: bin/55799: nsswitch.conf(5) man page
 > Date: Mon, 9 Nov 2020 15:02:40 -0000 (UTC)
 >
 >   20.100%defert.com@localhost 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@localhost
 >                                   "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@localhost">
       <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@localhost";>mlelstv%serpens.de@localhost</a> (Michael van Elst)
 To: <a class="moz-txt-link-abbreviated" href="mailto:gnats-bugs%netbsd.org@localhost";>gnats-bugs%netbsd.org@localhost</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@localhost";>20.100%defert.com@localhost</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@localhost";>mlelstv%serpens.de@localhost</a>
                                  "A potential Snark may lurk in every tree."
  
 </pre>
     </blockquote>
     <br>
   </body>
 </html>
 
 --------------27C2694BE57C6D01973129D1--
 



Home | Main Index | Thread Index | Old Index