On a machine without IPv6 support (IPv6 disabled in the kernel,
and no IPv6 addresses), how to prevent programs from using IPv6
by default?

For instance, with wget, I can provide the -4 option:

citron% wget -4 http://joooj.vinc17.net
--2026-09-08 04:50:12--  http://joooj.vinc17.net/
Resolving joooj.vinc17.net (joooj.vinc17.net)... 155.133.131.76
Connecting to joooj.vinc17.net (joooj.vinc17.net)|155.133.131.76|:80... 
connected.
HTTP request sent, awaiting response... 200 OK
Length: 10701 (10K) [text/html]
Saving to: ‘index.html’

index.html          100%[===================>]  10.45K  --.-KB/s    in 0s

2026-09-08 04:50:12 (149 MB/s) - ‘index.html’ saved [10701/10701]

But a few seconds later without this option:

citron% wget http://joooj.vinc17.net
--2026-09-08 04:50:18--  http://joooj.vinc17.net/
Resolving joooj.vinc17.net (joooj.vinc17.net)... 
2001:4b99:1:3:216:3eff:fe20:ac98
Connecting to joooj.vinc17.net 
(joooj.vinc17.net)|2001:4b99:1:3:216:3eff:fe20:ac98|:80... failed: Address 
family not supported by protocol.

This is bad.

I remember that in the past, I was using /etc/gai.conf on some
machine, but strace shows here that this file isn't accessed.

This is a Debian 12 (bookworm) machine, with nscd running.

This issue is fully reproducible for a few hours. Then it
disappears... before reappearing later. All the machines on the
local network (same config) seem to be affected, but not at the
same time. This seems random and may be related to DNS failures
("dig" sometimes returns SERVFAIL), but I cannot see how this
could be explain the above behavior.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Reply via email to