nsswitch.conf - db service for hosts

Peter Polgar ppeter.bme@gmail.com
Sun Jul 24 16:56:42 GMT 2022


Thanks! Now it's clear to me.

Then any idea on how to achieve a static fallback for IP if DNS fails?
My idea was to have it likes this:
hosts:   files mdns dns db

So files and mdns can handle localhost and .local first then if dns fails
db can have a record for the host in question. Without db this apparently
won't work.

Peter

On Sun, 24 Jul 2022, 16:07 Carlos O'Donell, <carlos@systemhalted.org> wrote:

> On Sat, Jul 23, 2022 at 6:19 PM Peter Polgar via Libc-help
> <libc-help@sourceware.org> wrote:
> > I am trying to use the db service in nsswitch.conf. I couldn't make it
> work
> > so I decided to get some hints from the source code.
> > A comment in test-netdb.c:310 says that "db is not implemented for
> hosts".
> > Also seen in the nss/Makefile:128 that "hosts" is filtered out from the
> > list of dbs.
> > Do these mean that db service is not implemented for hosts?
>
> Correct, hosts, network, key and alias are not provided for the db service.
>
> Not all backends provide all services.
>
> > If it is implemented how can I find the path where nsswitch is looking
> for
> > the db?
>
> It is not implemented. Not all backing stores are good choices for the
> kind of data to cache and the values that need to be cached.
>
> Adding hosts would require an evaluation of how the data should be
> stored and invalidated.
>
> Cheers,
> Carlos.
>


More information about the Libc-help mailing list