From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by sourceware.org (Postfix) with ESMTPS id 5C53F385840A for ; Sun, 24 Jul 2022 16:56:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C53F385840A Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-2ef5380669cso89172927b3.9 for ; Sun, 24 Jul 2022 09:56:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cGP7a7GzDFi4WuLzlyqzGcyXO60G8+bwOex+s2N3pac=; b=bpD0PNcfYzH5bGpUrW5LtIE8ySgFSc36HHG8f0QI50oYOG1CvbaDeWX4gQ+FEXvEI0 DXiVPwl5VVc3759PJ/tKLiGegnFGcPbwIi2Hrsc40TSO0ZwzyNVwLA2ksZHzUdCpHjjp HVWNvR5pSvCK7tcqUP+oDem+SZQkZ4EH05hB9c3KnJWzcZXqveUsqgUshB6lK5CK3RR3 +mh2OwD22MyY9sc4ZBt4xre7A3GCcYi8IkrwjnfMQs5GKyhjbMhfm9u2+/0LvmZloucz 9ZxvIOlKWYRGyk2eqtYaKChDVwFXNhQpINL9wrWbtGml88a7W2J9fQvahWXzmgfGnpy8 YPMA== X-Gm-Message-State: AJIora+cHG+QK9mna6jlZIjSFRl2bllSccrocSSkvqJmE4PWjqV/W90F m7rLL0yF+gS3EeUTwpPj/KZmsQv+chySdJQ/PiEU7g6p0po= X-Google-Smtp-Source: AGRyM1t2V8CMW6g1qd+q/2xw/g8A3tkZHdn8e03lcfJJj/6IZoMCK/hSIlL9cN0q2GNDKHzPntNJLF9uApMRu9kQwFk= X-Received: by 2002:a81:554f:0:b0:31e:5401:8533 with SMTP id j76-20020a81554f000000b0031e54018533mr7395700ywb.167.1658681810688; Sun, 24 Jul 2022 09:56:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Polgar Date: Sun, 24 Jul 2022 18:56:42 +0200 Message-ID: Subject: Re: nsswitch.conf - db service for hosts To: "Carlos O'Donell" , libc-help@sourceware.org X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2022 16:56:53 -0000 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, wrote: > On Sat, Jul 23, 2022 at 6:19 PM Peter Polgar via Libc-help > 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. >