lima-vm / lima-vm/lima

Using vznet binds port 53 on MacOS 13+, blocking other apps

Open
#2,176 3 comments 13 reactions 0 assignees View on GitHub
component/dns component/vz
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

When using the vznet networking option, as best I can tell this uses the new apple virtualization framework for the networking, which automatically binds port 53 to mDNSresponder *if that port is available*. If not, it picks a random high port and everything from what I can tell so far seems to work fine? Everything I've tried, anyway.

The problem here though is that some applications - in this particular case, Cloudflare Warp, but I believe other applications that essentially take over DNS like VPNs or DNS filtering in general - require this port specifically, because the idea is to not allow them to run side by side with something else that is also trying to take over DNS.

There is an ongoing issue in the [Rancher Desktop](https://github.com/rancher-sandbox/rancher-desktop/issues/2854) project about this, though I personally first experienced it with colima, and then verified with lima itself.

fwiw Docker Desktop has [an option called "kernelforUDP"](https://github.com/docker/for-mac/issues/7008) that, if you set it to false, works around this issue - but I don't really know the exact mechanism it uses or whether whatever that is would even work for lima. However, given that things seem to work (though again, only in the testing I've done; I'm sure there's a wider set of use cases to try) when port 53 is already taken and it picks something else - would it be possible to maybe have a config option that could somehow fake port 53 being used and/or in some other way force it to go pick another port? I'm quite new to all of this so I don't know enough about how it would work to try to PR it at this point, but I will certainly continue to look. I just thought I would post it here in the meantime so other eyes could be on it as well if they wanted.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.