Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DNS not being accessible with slirp4netns on hosts with IPv6-only nameservers #438

Merged
merged 2 commits into from
May 14, 2024

Conversation

redoste
Copy link
Contributor

@redoste redoste commented May 12, 2024

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.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit e484dd6 into rootless-containers:master May 14, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants