LLMNR causes login delay on Debian
- Dominant language
- Go
- Stars
- 21.9k
- Forks
- 957
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 53
Description
### Description
I have noticed an undesired behaviour when using Lima with Debian 13.
# Steps to reproduce
Create a new VM like this: `limactl create --name=myvm template:debian-13`
Start the VM: `limactl start myvm`
Run this command and notice how long it takes to complete:
`ssh -F $HOME/.lima/myvm/ssh.config lima-myvm /usr/bin/true`
Then run almost the same command again, except this time we force pseudo-terminal allocation. Notice how long it takes to complete.
`ssh -t -F $HOME/.lima/myvm/ssh.config lima-myvm /usr/bin/true`
# What I expected to happen
That both commands would finish instantly.
# What actually happens
The first command (no pseudo-terminal) finishes instantly.
The second command, where the pseudo-terminal is allocated, has a quite significant delay before completing. On my system it takes about four seconds to complete.
# Workaround
In the VM, the file `/etc/systemd/resolved.conf.d/00-lima-enable-mdns.conf` is created by Lima. Modify it to look like this:
```
[Resolve]
MulticastDNS=yes
LLMNR=no
```
Now restart the resolver:
`sudo systemctl restart systemd-resolved.service`
When Link-Local Multicast Name Resolution is disabled, there is no login delay.
# Alternative workaround
Add the following lines to `/etc/hosts` in the VM:
```
127.0.0.1 UNKNOWN
::1 UNKNOWN
```
# Why the delay happens
It seems like sshd sets the string `UNKNOWN` as the client hostname. Then it tries to resolve that hostname, an operation which obviously fails after a time-out. I don’t know why the issue only occurs for interactive sessions.
# Suggestion for permanent solution
One possible solution could be to add the `LLMNR=no` directive permanently. I’m not sure what side-effects it might have.
Contributor guide
Research direction
Start by tracing how /etc/systemd/resolved.conf.d/00-lima-enable-mdns.conf is generated for the Debian 13 template. Reproduce the delay with the two ssh commands, then test the configuration change that disables LLMNR while preserving the intended mDNS behavior. Done means interactive SSH completes without the delay on a new Debian 13 VM.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- debian, linux
- Domain
- networking, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100