rootless-containers / slirp4netns

User-mode networking for unprivileged network namespaces
GNU General Public License v2.0
715 stars 82 forks source link

Load search domains from /etc/resolv.conf #312

Open geofft opened 1 year ago

geofft commented 1 year ago

It seems like VPNKit looks at the host's /etc/resolv.conf to figure out the DNS search domains (see e.g. src/dns_forward/dns_forward_config.ml), but slirp4netns doesn't seem to have that functionality. It looks like libslirp supports this with char ** vdnssearch in the config structure, but slirp4netns sets this to NULL.

Would there be interest in parsing out the host's /etc/resolv.conf and setting vdnssearch?

(This is causing users at our organization to think that networking isn't set up right when moving from VPNKit to slirp4netns, because short domains aren't resolving.)