3 ms·
I've encountered a similar failure, when some old process still claimed [::]:80 when I restarted the web server, probably a lingering socket or something like t
by jeroenhd 5y ago
I've encountered a similar failure, when some old process still claimed [::]:80 when I restarted the web server, probably a lingering socket or something like that, which made the new process only bind to 0.0.0.0:80. It took me a while to find out why my changes weren't being reflected when I could see the binding _right there_ in `ss -tlpn`!
Honestly, I don't think it's too unreasonable to argue that if a client has IPv6 connectivity and a hostname has a valid AAAA record, the connection should be established over IPv6. Browsers tend to have fallbacks to IPv4, but outside browsers you'll be surprised how little actual system software cares about DNS fallback.
Reading the BusyBox source code (https://elixir.bootlin.com/busybox/latest/source/libbb/xconnect.c#L176 https://elixir.bootlin.com/busybox/latest/source/libbb/xconn...) it seems like it will pass AF_UNSPEC to str2sockaddr, which is packed into `addrinfo hint` and then passed on to getaddrinfo(). Only when IPv6 support is disabled or ENABLE_FEATURE_PREFER_IPV4_ADDRESS is enabled will busybox shuffle around the DNS results to return an IPv4 address.
If your service isn't available on IPv6 yet your hostname has a valid IPv6 record, it's your task to indicate this to the software (using the -4 flag, for example) or to configure it to retry.