rootlesskit
rootlesskit copied to clipboard
Fix DNS not being accessible with slirp4netns on hosts with IPv6-only nameservers
libslirp will provide DNS to the "guest side" simply by forwarding IPv4 UDP packets to the IPv4 host nameserver and idem for IPv6.
See https://gitlab.freedesktop.org/slirp/libslirp/-/blob/6ea2c4f95922a64d21190d9ad163e3bbde37a836/src/socket.c#L971 and https://gitlab.freedesktop.org/slirp/libslirp/-/blob/6ea2c4f95922a64d21190d9ad163e3bbde37a836/src/socket.c#L990
On a host with only IPv4 or IPv6 nameservers this will make only 10.0.2.3 or fd00::3 functional.
This PR will fix DNS issues on hosts with only IPv6 DNS (such as on a network using NAT64 and DNS64 without client-side address translation) by advertising to the child process the Slirp IPv6 DNS address.