Am 21.09.26 um 03:00 schrieb Vincent Lefevre:
On 2026-09-20 09:23:48 +0200, Marco Moock wrote:
Am 19.09.26 um 23:40 schrieb Vincent Lefevre:
In any case, I don't see why IPv6 support in the kernel matters
for nscd. I don't see any reason why nscd would do an IPv6
connection; that's useless for name resolving.
nscd is only a cache for libc, it does not do any lookups. The sources
defined in nsswitch.conf do the lookups.
This is incorrect: when nscd is running, nsswitch.conf is not
used at all by the program that calls getaddrinfo! There's only
a connection to "/var/run/nscd/socket".
It still does not do any DNS lookups, it uses the libraries in listed in
nsswitch.conf.
If they handle SERVFAIL improperly, it is not nscd's fault.
Now, does the nscd(8) man page depend on the *Linux* distribution?
No, as they usually use the same glibc. Although, some distributions
stopped shipping nscd, e.g. Fedora.
When possible, use standard tools like getent instead of custom
programs or scripts.
getent does *not* work in the same way. In particular, in the test,
I got an exit status 2 in each case while IP addresses were available
in each case (e.g. with getaddrinfo). And no error messages at all.
That's very unhelpful.
Can you give a test case?
Already given, with results, in <[email protected]>
(Sun, 13 Sep 2026 02:35:49 +0200). This is:
#!/bin/sh
getent ahostsv4 $1 || echo "Error: $?"
getent ahostsv6 $1 || echo "Error: $?"
getent ahosts $1 || echo "Error: $?"
I tried that on my machine with google.com as argument, works fine.
$ grep hosts /etc/nsswitch.conf
hosts: files dns
nscd is enabled and working (I searched the cache with the strings command).
But I suspect that you tried with a DNS server that does not return
random SERVFAIL errors.
No, but I do not have one that behaves like that.
But if that is the issue, you need to identify the library in
nsswitch.conf that doesn't handle the responses properly and report the
bug there.
--
Gruß
Marco
Spam bitte an [email protected]