Skip to content

Epic: Use Lima host resolver on Windows #1899

@jandubois

Description

@jandubois

We want to use the Lima host resolver to take advantage of all the DNS configuration on the host itself (automatic support of split-DNS over VPN etc).

The resolver code should be in a separate repo at https://github.com/rancher-sandbox/rancher-desktop-host-resolver. It currently uses a fork of pkg/hostagent/dns.go from Lima to allow rapid development. Once this task is complete, any changes should be back-ported upstream.

  • Add cobra commandline processing. Add options for the listening interface, the tcp and udp ports, IPv6 support, and built-in hostnames (like host.docker.internal).

  • Choose random available ports when tcp/udp ports are not specified.

    Look at the findXXXFreeLocalPort functions; we should be able to reuse them.

  • Add an option to specify allowed source addresses and reject connections not from allowed sources.

    For WSL2 we will need to connect via the host IP address, but we don't want to accept outside connections. Look at the pseudo loopback forwarder for a possible implementation (except that one checks destination, not source address).

NOTE: For the above item, a different approach was taken. To avoid filtration of the incoming DNS requests. The host-resolver runs two processes, 1) In wsl distro 2) on the windows host machine, the communication happens over a dedicated AF_VSOCK connection, therefore the process that runs on the windows host machine can only accept DNS lookups that are incoming over the AF_VSOCK connection.

  • Create Github action to make releases

  • Download host resolver in Rancher Desktop resources

  • Start/stop host resolver before/after the WSL2 distro is started

  • Replace dnsmasq with the host resolver.
    NOTE: for the item above, we are allowing the users to choose between host-resolver or dnsmaq through experimentalHostResolver configuration flag.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions