On a machine without IPv6 support (IPv6 disabled in the kernel,
and no IPv6 addresses), how to prevent programs from using IPv6
by default?
So, if you want to reproduce the issue, set up a network
where DNS requests to the nameservers in /etc/resolv.conf
randomly fail. And (probably) use nscd.
On 2026-09-10 10:00:16 +0700, Max Nikulin wrote:
On 10/09/2026 6:37 am, Vincent Lefevre wrote:
this is because getaddrinfo returns
only the IPv6 address. This is not a question of precedence.
Great. Do you see any benefits in disabling IPv6 on your machine?
Disabling completely, apparently not. Disabling a part of it, such
as SLAAC, yes, because in the past, some machines on the network
sent fake RA advertising. My main personal machine on the network
just has SLAAC disabled for this reason.
Have you figured out if changes made in libc to handle the case of
SERVFAIL for A and success for AAAA queries affect nscd? Some
security issues are mentioned in the bug tracker.
I don't know. Note that I've also seen the reverse on the concerned
machine: AF_INET giving the IPv4 address and AF_INET6 giving the
IPv6 address as always, but AF_UNSPEC giving only the IPv4 address.
(Of course, even though this is buggy, it is fine for me.)
Have you tried to stop nscd to compare if general impression is better?
Nothing has been done yet, AFAIK (I am not the admin, and I can still
see nscd running).
I've found
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/4K634Q3567QMMVJIGXM6I6MOJPOWO6QF/
(November 2020): "While still maintained within the glibc source tree, ''nscd'' has received less than forty commits in the past three years
and has gathered significant technical debt, and has bugs which are
hard to fix. There are concurrency bugs in the shared mappings, cache unification (IPv4 vs. IPv6 vs. AF_UNSPEC) issues, and more which would require significant investment to fix in nscd."
But I'd say that SERVFAIL should not be cached as it may be a temporary failure.
Another question is whether it is reasonable to invest efforts into
suppressing AAAA queries completely at the libc level when IPv6 is
disabled.
This is probably not the way the nscd issue should be fixed (it is
not even sure that it fixes aything, and it wouldn't fix anything
when IPv6 isn't disabled but doesn't work).
On 2026-09-08 14:44:07 +0200, Marco Moock wrote:
Am 08.09.26 um 12:10 schrieb Vincent Lefevre:
So, if you want to reproduce the issue, set up a network
where DNS requests to the nameservers in /etc/resolv.conf
randomly fail. And (probably) use nscd.
How is that related to IPv6?
If you have a faulty DNS setup, fix that first.
I don't see where it is faulty (to the point of getting the
observed behavior).
/etc/resolv.conf is queried by the order of entries by default every
time a request is being made.
strace does not show any access to this file when AF_UNSPEC is used.
Also check the nsswitch.conf, there might be additional entries for hosts
and resolve might be listed there, which is systemd-resolve, a local DNS
cache acting as a DNS server.
There is already a local DNS cache: nscd.
To be clearer: dig queries only IPv4 by default (for the "-t type"
option: "The default query type is A"), and I sometimes get SERVFAIL
with it, but a request a few seconds later seems to always succeed.
On 2026-09-12 01:09:06 +0700, Max Nikulin wrote:
On 10/09/2026 11:46 pm, Vincent Lefevre wrote:
On 2026-09-10 10:00:16 +0700, Max Nikulin wrote:
On 10/09/2026 6:37 am, Vincent Lefevre wrote:
this is because getaddrinfo returns
only the IPv6 address. This is not a question of precedence.
Do you see any benefits in disabling IPv6 on your machine?
Disabling completely, apparently not. Disabling a part of it, such
as SLAAC, yes, because in the past, some machines on the network
sent fake RA advertising. My main personal machine on the network
just has SLAAC disabled for this reason.
BTW, on this point, disabling SLAAC is a bit complex. I thought that accept_ra = 0 was sufficient (at least when I added it in 2015), but
it was actually ignored by NetworkManager, for which I had to add ipv6.dns-priority=-100 in its configuration several months ago.
Thanks for clearly stating it. I asked, looking at the thread subject, since >> host name resolution to IPv6 addresses and IPv6 link configuration are
orthogonal to some degree and it is not immediately obvious.
Note that I was not really complaining about the host name resolution
to IPv6 addresses; but from their error message, I thought that some utilities (ping, wget...) tried an IPv6 connection without trying
IPv4.
Perhaps I should have looked closely to what ssh was giving (FYI, this
is because I got ssh failures for a repository update that I tried
with other tools):
ssh: Could not resolve hostname joooj.vinc17.net: Name or service not known
This is clearer that the issue is not directly related to IPv6, but
rather related to name resolution. I suppose that since socket()
fails for IPv6 (because it has been disabled in the kernel), ssh
ignores IPv6 completely. So this would be another reason to disable
IPv6 in the kernel when it is not supported by the network: to
hopefully get more meaningful error messages.
Have you figured out if changes made in libc to handle the case of
SERVFAIL for A and success for AAAA queries affect nscd? Some
security issues are mentioned in the bug tracker.
I don't know. Note that I've also seen the reverse on the concerned
machine: AF_INET giving the IPv4 address and AF_INET6 giving the
IPv6 address as always, but AF_UNSPEC giving only the IPv4 address.
(Of course, even though this is buggy, it is fine for me.)
In my opinion, it is realm of trade-offs and compromises. Should an
application expect different result on retry if it has got 1 success and 1 >> error for A and AAAA queries? Sometimes delays and timeouts are annoying for >> users. In other cases reliability is preferred.
Here, caching is used locally on the machine (with nscd). This is
a cache inconsistency. This is not a question of compromise.
Maybe you are motivated much more than libc developers to find a way to >>>> better handle your specific case.
I don't think that this is a specific case. I suppose that a SERVFAIL
due to network issues can happen everywhere.
While errors are rare, their effect is hardly noticeable.
When errors are cached for several hours, they are much more noticeable!
However does libc really performs retry when it gets SERVFAIL, not timeout?
There doesn't seem to be any retry (this would be useless anyway
in my case).
Again, if you are saying that without AAAA query resolver reliably gets IPv4 >> addresses, it might be an approach. By the way, resolv.conf(5):
options
no-aaaa (since glibc 2.36)
Interesting to know. I'll suggest that to the admin.
And how do you think applications know that IPv6 is disabled in the
kernel? Do you suggest somebody who disables IPv6 in the kernel should rebuild all applications with `./configure --disable-ipv6`?
On 2026-09-15 22:07:42 +0200, Marco Moock wrote:
Am 13.09.26 um 00:30 schrieb Vincent Lefevre:
To be clearer: dig queries only IPv4 by default (for the "-t type"
option: "The default query type is A"), and I sometimes get SERVFAIL
with it, but a request a few seconds later seems to always succeed.
That is a clear indicator that the DNS server that it queries has an issue. >> It shows which one it uses. Investigate that.
I recall that I am not the admin. So I cannot. I'm still waiting
for information from the ticket I had opened.
On 2026-09-15 22:07:02 +0200, Marco Moock wrote:
Am 13.09.26 um 00:00 schrieb Vincent Lefevre:
On 2026-09-12 01:09:06 +0700, Max Nikulin wrote:
On 10/09/2026 11:46 pm, Vincent Lefevre wrote:
On 2026-09-10 10:00:16 +0700, Max Nikulin wrote:
On 10/09/2026 6:37 am, Vincent Lefevre wrote:
this is because getaddrinfo returns
only the IPv6 address. This is not a question of precedence.
Do you see any benefits in disabling IPv6 on your machine?
Disabling completely, apparently not. Disabling a part of it, such
as SLAAC, yes, because in the past, some machines on the network
sent fake RA advertising. My main personal machine on the network
just has SLAAC disabled for this reason.
BTW, on this point, disabling SLAAC is a bit complex. I thought that
accept_ra = 0 was sufficient (at least when I added it in 2015), but
it was actually ignored by NetworkManager, for which I had to add
ipv6.dns-priority=-100 in its configuration several months ago.
This doesn't disable SLAAC, but if that mitigates your problem, there is a >> major problem - and it is not SLAAC neither IPv6.
I don't know whether this mitigates the problem on this machine.
Then what do you suggest?
Thanks for clearly stating it. I asked, looking at the thread subject, since
host name resolution to IPv6 addresses and IPv6 link configuration are >>>> orthogonal to some degree and it is not immediately obvious.
Note that I was not really complaining about the host name resolution
to IPv6 addresses; but from their error message, I thought that some
utilities (ping, wget...) tried an IPv6 connection without trying
IPv4.
As you refuse to show the output of "ip a", it is not possible to help here.
Perhaps you should read the whole thread. I gave it last week:
Date: Tue, 8 Sep 2026 18:48:17 +0200
From: Vincent Lefevre <vincent@vinc17.net>
To: debian-user@lists.debian.org
Subject: Re: How to prevent programs from using IPv6 by default on a machine without IPv6 support?
Message-ID: <20260908164817.GP1165915@qaa.vinc17.org>
nscd is not installed by default in Debian. Please show us the
configuration.
enable-cache hosts yes
positive-time-to-live hosts 3600
negative-time-to-live hosts 20
However does libc really performs retry when it gets SERVFAIL, not timeout?
There doesn't seem to be any retry (this would be useless anyway
in my case).
Again, if you are saying that without AAAA query resolver reliably gets IPv4
addresses, it might be an approach. By the way, resolv.conf(5):
options
no-aaaa (since glibc 2.36)
Interesting to know. I'll suggest that to the admin.
Another shitty idea, as this doesn't address the real issue. Just my 2
cents.
So what do you suggest?
On 2026-09-15 21:46:17 +0200, Marco Moock wrote:
Am 10.09.26 um 18:50 schrieb Vincent Lefevre:
On 2026-09-10 10:00:16 +0700, Max Nikulin wrote:
On 10/09/2026 6:37 am, Vincent Lefevre wrote:
this is because getaddrinfo returns
only the IPv6 address. This is not a question of precedence.
Great. Do you see any benefits in disabling IPv6 on your machine?
Disabling completely, apparently not. Disabling a part of it, such
as SLAAC, yes, because in the past, some machines on the network
sent fake RA advertising. My main personal machine on the network
just has SLAAC disabled for this reason.
Then investigate which machine that is. It might be a bogus attacker
or just a completely misconfigured device.
I just know that misconfigured devices are found on the network.
Have you figured out if changes made in libc to handle the case of
SERVFAIL for A and success for AAAA queries affect nscd? Some
security issues are mentioned in the bug tracker.
I don't know. Note that I've also seen the reverse on the concerned
machine: AF_INET giving the IPv4 address and AF_INET6 giving the
IPv6 address as always, but AF_UNSPEC giving only the IPv4 address.
(Of course, even though this is buggy, it is fine for me.)
Have you tried to stop nscd to compare if general impression is better? >>>Nothing has been done yet, AFAIK (I am not the admin, and I can still
see nscd running).
Disable it for testing or at least clear the cache.
Is there a way to disable it for testing, as non-root?
Note that I can still test on domains that are not in the cache.
This is how I can see that there are still temporary failures,
probably due to SERVFAIL from the nameservers.
If disabling IPv6 mitigates the problem, there is a serious problem
on your machine/network, that needs to be investigated and fixed.
There is a serious problem with nscd, as already said.
Disabling IPv6 is a dead-end street.
I don't see why. IPv6 is not supported on the network, so there
are no drawbacks in disabling it for hostname resolution. And if
it were supported, then there wouldn't have been any major issue
with nscd.
On 2026-09-16 11:43:35 +0200, Marco Moock wrote:
Am 16.09.26 um 05:00 schrieb Vincent Lefevre:
I just know that misconfigured devices are found on the network.
They need to be removed, as they disturb any other device.
They can also be used for MITM attacks.
You definitely do not want such machines in your productive network.
This is a network where everyone can plug their own machine.
Even though it is not allowed to disturb the network, this
happens, most often due to Apple crap.
There is a serious problem with nscd, as already said.
I have doubt. If nscd caches a negative response (from the faulty DNS), it >> will not try again until the cache expired. Works as intended.
No, this is *not* a negative response, but a *temporary* failure.
FYI, without nscd, the gai_strerror error message from getaddrinfo
is "Temporary failure in name resolution".
^^^^^^^^^^^^^^^^^
This is not expected to be cached for a long time (due to nscd,
I got errors for hours, even though temporary failure actually
lasted for 1 second or so).
Disabling IPv6 is a dead-end street.
I don't see why. IPv6 is not supported on the network, so there
are no drawbacks in disabling it for hostname resolution. And if
it were supported, then there wouldn't have been any major issue
with nscd.
You do not try to solve the real issue,
This is a workaround mainly due to a nscd bug.
which will affect other machines too. That is your big problem.
I don't see how this could affect other machines. What do you mean?
On 2026-09-17 10:22:24 +0700, Max Nikulin wrote:
My point is that, reporting a bug, you should avoid non-essential steps to >> reproduce it. More generic configuration that is closer to defaults means
that the scope of the issue is wider. It require less efforts to try and to >> create debug environment. In this thread you see that mention of disabled
IPv6 may insult people. Reaction of developers might be similar.
"mention of disabled IPv6 may insult people"???
Since error messages are different, it is better to describe primary
scenario with default IPv6 configuration (local addresses, no global
routing).
I could not try. That's not my fault if non-root users cannot test
(emulate) such a configuration.
Your bug report lacks timestamps that proof that partial failure is treated >> as success while the setting to quickly expunge negative results from the
cache is respected.
I was not aware of how nscd worked at the time of the bug report.
The nscd(8) man page is ridiculously uninformative. Developers
should do their work first.
BTW, I've just found that the French (and much older) version is much
more informative: http://manpagesfr.free.fr/man/man8/nscd.8.html
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.
On 2026-09-19 20:41:06 +0200, Marco Moock wrote:
Am 18.09.26 um 14:30 schrieb Vincent Lefevre:
On 2026-09-17 10:22:24 +0700, Max Nikulin wrote:
My point is that, reporting a bug, you should avoid non-essential steps to >>>> reproduce it. More generic configuration that is closer to defaults means >>>> that the scope of the issue is wider. It require less efforts to try and to
create debug environment. In this thread you see that mention of disabled >>>> IPv6 may insult people. Reaction of developers might be similar.
"mention of disabled IPv6 may insult people"???
No, but it is a rather uncommon situation.
What is actually uncommon is a network with unsupported IPv6
and DNS servers that often return SERVFAIL.
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.
Then you cannot reasonably open a bug report - because the developers will >> ask you to do such test. Set up a test environment (e.g. Virtualbox) and
track the issue down.
Developers could (should) do their own tests: testing the behavior
of nscd with an initial SERVFAIL for IPv4 and a valid IPv6 address
(or the reverse).
I was not aware of how nscd worked at the time of the bug report.
The nscd(8) man page is ridiculously uninformative. Developers
should do their work first.
It is simply a cache for requests using the libc functions. Be aware that
the libc stuff is different in Linux/BSD/UNIX, so you may find information >> that does not apply to the Linux implementation.
I was just asking for the cache specification for nscd.
BTW, I've just found that the French (and much older) version is much
more informative: http://manpagesfr.free.fr/man/man8/nscd.8.html
That doesn't say from which distribution it came (at
I suppose that this corresponds to upstream.
Or does the nscd(8) man page depend on the distribution?
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 <20260913003549.GE20864@qaa.vinc17.org>
(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: $?"
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".
Now, does the nscd(8) man page depend on the *Linux* distribution?
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 <20260913003549.GE20864@qaa.vinc17.org>
(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.
Short version: my ISP does not (yet) provide IPv6 connectivity, and my
router was supplied by the ISP so already had IPv6 disabled. I was
having trouble with DNS failures due to bind9 not finding an IPv6
route out of the network and giving up, even though the requested host
also had an IPv4 address.
OPTIONS="-u bind"root@issola:~#
I was advised that disabling IPv6 in the kernel was the final fix,??.
IPv6 seems to be the future, so I guess these problems will eventually
fade away, although the OP has been struggling since 2015 (!),
apparently, which is a testament to something.
On Sun, 20 Sep 2026 20:41:21 +0200
<tomas@tuxteam.de> wrote:
On Sun, Sep 20, 2026 at 03:18:12PM -0000, CGS wrote:
On 2026-09-19, Vincent Lefevre <vincent@vinc17.net> wrote:
Isn't significant part of this thread is dedicated to arguments
that you should not disable IPv6?
No-one has explained why IPv6 should not be disabled. And in any
case,
Conversely, have you explained why IPv6 was disabled? I may have
missed it in this long thread, but it obviously adds a layer of
complexity to whatever problem you're trying to solve as an
non-priviledged user.
Yes, it was explained in this thread. AFAIR, the box receives IPv6
router advertisements, so it thinks it has IPv6 connectivity, but the
routes lead to nowhere.
Correct me if I'm wrong, though.
For completeness, I was also in the thread early with a need to disable
it.
Short version: my ISP does not (yet) provide IPv6 connectivity, and my
router was supplied by the ISP so already had IPv6 disabled. I was
having trouble with DNS failures due to bind9 not finding an IPv6
route out of the network and giving up, even though the requested host
also had an IPv4 address.
However, it will return IPv6 addresses, so you may still need to turn
off IPv6 in other programs.
On 21/09/2026 5:06 pm, Marco Moock wrote:
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.
Marco, are you familiar with related API? Is it possible to mark result
as partially failed?
Consider the following case:
- libnss_dns sends A and AAAA queries due to AF_UNSPEC argument.
- The result for AAAA is success with some addresses.
- "A" fails with some error.
When cache is not involved, trying IPv6 is the best that the calling application can do. So the result is not simple failure. It is rather success.
However this partial result should be cached as negative to retry soon.
I am curious if the resolver plugin may do its job better or it is limitation of the plugin protocol that results are either failures and
no addresses are returned or they are pure successes.
Exactly. Of course, at that time, I asked the admins to take measures
to filter RAs. They answered me something like this was not possible
with their old routers (which might be the same reason why we still
do not have IPv6 here: old material, but also too few admins to take
care of the problems). I don't know whether things have improved
since 2015, but a few months ago (in March), on one of my machines,
a "nameserver fe80::a4cf:99ff:fe46:c64%enp0s25" line appeared in /etc/resolv.conf (generated by NetworkManager), apparently due to
some rogue RA.
On 2026-09-21 12:06:03 +0200, Marco Moock wrote:
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.
This is still part of the nscd process.
If they handle SERVFAIL improperly, it is not nscd's fault.
I don't see how this is related to IPv6 support in the kernel.
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 <20260913003549.GE20864@qaa.vinc17.org> >>>>> (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.
This was important for the test.
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.
This does not say how nscd uses nsswitch.conf (/etc/nsswitch.conf
contains "hosts: files dns", so "dns" applies, but this does not say
how name resolving is done). The nscd developers should document that
first.
(my guess is that nscd uses more or less libc's plain old non-caching resolver, but caches things along their way).
The issue is that nscd caches for an hour results with some IPv6
addresses and no IPv4 ones due to SERVFAIL in response to the A query.
As a result various tools can not connect the host due to lack of global IPv6 routing.
You claim that it is not nscd failure. It is possible from my point of
view. You blame a resolver plugin that is actually libnss_dns. My idea
is that the trouble might be caused by plugin design, so plugins have no chance to do their job better. The latter case is in agreement that "it
is not nscd's fault".
Nscd does not behave as documented, or its documentation is
incomplete. For instance:
negative-time-to-live service secs
If an entry is not found by the Name Service, [...]
but what is an entry when dealing with both IPv4 and IPv6?
On 2026-09-22 15:37:59 +0200, Marco Moock wrote:
Am 22.09.26 um 11:40 schrieb Vincent Lefevre:
On 2026-09-21 12:06:03 +0200, Marco Moock wrote:
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.
This is still part of the nscd process.
I a quite sure it isn't. But feel free to ask at the libc mailing lists,
there are the people who developed this.
So, you think that the nscd process contacts another daemon?
If they handle SERVFAIL improperly, it is not nscd's fault.
I don't see how this is related to IPv6 support in the kernel.
It might, as a system with IPv6 support disabled will most likely never as >> for AAAA, which might change the (probably faulty) behavior.
What do you mean?
This does not say how nscd uses nsswitch.conf (/etc/nsswitch.conf
contains "hosts: files dns", so "dns" applies, but this does not say
how name resolving is done). The nscd developers should document that
first.
Please suggest that at sourceware.org, where the programmers of libc have
the repo.
Done here: https://sourceware.org/bugzilla/show_bug.cgi?id=34668
On 2026-09-22 15:33:05 +0200, Marco Moock wrote:
Am 22.09.26 um 05:30 schrieb Max Nikulin:
The issue is that nscd caches for an hour results with some IPv6
addresses and no IPv4 ones due to SERVFAIL in response to the A query.
As a result various tools can not connect the host due to lack of global >>> IPv6 routing.
Not an IPv6 issue and not an nscd issue.
If nscd caches the positive (e.g. answer with A/AAAA record) or negative
(server replies that the requested record does not exist) answer, it is
operation correctly. The failing DNS servers need to be handled at
libnss_dns.
Or perhaps nscd just misuses libnss_dns. Without documentation of
how nscd uses this library exactly, who knows?
I know, and the admins of the ENS-Lyon network (who are also in charge
of the security at this level) probably know that too. That's why
ignoring RAs is important, and the lack of official documentation
of how to do that (and the surprising behavior of existing options)
may lead to the radical solution of disabling IPv6 in the kernel.
On 2026-09-21 18:37:04 +0200, Nicolas George wrote:
Millions of people in the world use Linux with ISPs and routeurs without
IPv6 support and they do not need to disable anything.
This does not mean that others will not have any issue either. In my
case, at home in 2017, after a power outage in the whole neighborhood,
IPv6 was no longer working with my ISP (SFR). Here's what I was getting
for a remote-to-local traceroute:
ioooi:~> mtr -brw 2a02:8429:80cd:3100::1
Start: Wed Jul 19 16:11:15 2017
HOST: ioooi Loss% Snt Last Avg Best Wrst StDev
1.|-- 2001:4b98:dc0:45::250 0.0% 10 0.7 1.2 0.7 3.0 0.6
2.|-- p252-core4-d-ip6.paris.gandi.net (2001:4b98:1f::c4d3:181) 0.0% 10 4.0 2.5 1.3 4.0 0.7
3.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
4.|-- 2a02-8400-0000-0003-0000-0000-0000-421a.rev.sfr.net (2a02:8400:0:3::421a) 0.0% 10 8.2 6.7 2.8 12.0 2.8
5.|-- 2a02-8400-0000-0003-0000-0000-0000-104d.rev.sfr.net (2a02:8400:0:3::104d) 0.0% 10 4.1 5.7 2.7 11.9 2.4
6.|-- 2a02-8400-0000-0003-0000-0000-0000-104d.rev.sfr.net (2a02:8400:0:3::104d) 0.0% 10 2.2 4.8 2.2 14.1 3.4
7.|-- 2a02-8400-0000-0003-0000-0000-0000-11a6.rev.sfr.net (2a02:8400:0:3::11a6) 0.0% 10 2.5 15.4 2.0 131.4 40.8
8.|-- 2a02-8400-0000-0003-0000-0000-0000-000a.rev.sfr.net (2a02:8400:0:3::a) 0.0% 10 2.5 4.3 1.9 22.8 6.5
9.|-- 2a02-8429-80cd-bd00-0000-0000-0000-0001.rev.sfr.net (2a02:8429:80cd:bd00::1) 0.0% 10 10.3 11.2 8.5 13.1 1.2
10.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
and in the opposite direction:
zira:~> mtr -6brw ioooi.vinc17.net
Start: Sat Jul 22 14:50:51 2017
HOST: zira Loss% Snt Last Avg Best Wrst StDev
1.|-- box (2a02:8429:80cd:3100::1) 0.0% 10 0.6 0.6 0.5 0.6 0.0
2.|-- 2a02-8400-0000-0002-0000-0000-0000-08b0.rev.sfr.net (2a02:8400:0:2::8b0) 0.0% 10 2.3 3.2 1.0 5.1 1.2
3.|-- 2a02-8400-0000-0003-0000-0000-0000-2af1.rev.sfr.net (2a02:8400:0:3::2af1) 0.0% 10 2.5 3.9 2.3 5.9 1.2
4.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
SFR told me that there were no issues on their side.
This lasted several weeks.
What I did at that time was to put
precedence ::ffff:0:0/96 100
in /etc/gai.conf to prefer IPv4 connections. This was sufficient;
however, I suppose that this would not be ideal for hosts with only
an IPv6 address (timeout instead of immediate failure).
This actually comes from the official Linux man pages... and
the issue is in Debian, which apparently comes from BSD. In
bookworm:
NSCD(8) BSD System Manager's Manual NSCD(8)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The "BSD" has been removed in trixie, but the man page remains
the same one from 2001. The description in the above man page
is more detailed (though still incomplete). I've reported a bug.
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 498677:21:04 |
| Calls: | 212 |
| Calls today: | 3 |
| Files: | 910 |
| D/L today: |
31 files (22,593K bytes) |
| Messages: | 69,826 |