Multiple communications do not work most of the time making musl's DNS resolution in the guest unusable
When running alpine linux under qemu -net user
or podman -network slirp4netns
(the default podman rootless network) it only works when all the nameservers in /etc/resolv.conf
are reachable. In alpine the musl DNS resolution is correct, It just makes for the easiest reproducer of this particular problem, but it probably affects other communications as well. I noticed this with podman first because podman appends 8.8.8.8
and 8.8.4.4
nameservers after the 10.0.2.3
one which makes this fail because the google nameservers are blocked on the network I am on. I first blamed slirp4netns, then musl and the alpine linux container (in this issue). After that I tried it with qemu and with the virtualised interface it works fine, but it breaks with usermode networking. Various ways to reproduce this can be seen in the issue linked above, here is a short info:
/ # echo "nameserver 10.0.2.3" >/etc/resolv.conf
/ # time getent hosts asdf.com
64.90.40.65 asdf.com asdf.com
real 0m 0.20s
user 0m 0.00s
sys 0m 0.00s
/ # echo -e "nameserver 10.0.2.3\nnameserver 8.8.8.8" >/etc/resolv.conf
/ # time getent hosts asdf.com
Command exited with non-zero status 2
real 0m 10.01s
user 0m 0.00s
sys 0m 0.00s
As I said, the whole premise is that dns queries to 8.8.8.8
are blocked in my network. When I try that in another network it works fine. I captured the network traffic and all requests and responses to my local (on the host) dnsmasq are going through.
One thing that might come in handy when debugging this is that musl creates one udp socket, binds it to 0.0.0.0:53
and uses that to send the request and wait for responses. All tcpdump and strace captures might be seen in the aforementioned issue as well.