Some limitations of the built-in DNS service
- Dominant language
- Go
- Stars
- 21.9k
- Forks
- 957
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 53
Description
I spent some time testing various DNS scenarios while looking into https://github.com/rancher-sandbox/rancher-desktop/issues/1181 and noticed the following issues:
* on `systemd` instances mDNS lookup would not work. The request never goes to our own server, but is presumptively handled directly by `systemd-resolved`. Since it can only broadcast on the slirp interface, it can't find any devices on the host network.
* `*.local` names that are provided by DNS and have no corresponding mDNS response are reported too late, so get a DNS timeout. It looks like our DNS server is waiting for the mDNS query to time out before returning the DNS name (or from `/etc/hosts`).
While looking for a workaround, I tried (on Alpine, to avoid systemd) various entries in `/etc/hosts`. Specifying a `.local` name as an alias works, and both names can be resolved in the guest:
```
1.2.3.4 foo.internal foo.local
```
If the `.local` name is the canonical name, then neither name returns a result before an error occurs:
```
1.2.3.4 foo.local foo.internal
```
On the host system, the `.local` names from `/etc/hosts` are resolved without any delay, so why is this different?
Contributor guide
Assessment
This issue has not been assessed yet.