Fix Slow Local Name Resolution

Jan 02, 2020

I was having some trouble with it takeing about 10 seconds to resolve names on the local network like tight-seat.local.

My network stack is systemd-networkd and systemd-resolved, and it turns out that the issue here is that both these programs default to enabling LLMNR, a protocol invented by Microsoft that failed to be standardized because the standardization bodies realized that mDNS already existed and didn’t have massive security flaws.

Microsoft-bashing aside, the solution is to disable LLMNR and enable mDNS.

The Arch Linux wiki is very descriptive on this issue:

By default systemd-resolved enables mDNS responder, but both systemd-networkd and NetworkManager do not enable it for connections

By default systemd-resolved enables LLMNR responder; systemd-networkd and NetworkManager enable it for connections.

The following /etc/systemd/network/mdns.network will disable LLMNR and enable mDNS:

[Match]
Name=enp* wlp*

[Network]
MulticastDNS=true
LLMNR=false

And that’s it.