You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local IP address reverse lookup is slow when LLMNR=resolve #16243
systemd version the issue has been seen with
systemd 245 (245)
Used distribution
Gentoo
Expected behaviour you didn't see
Local IP address lookup works fine regardless of LLMNR setting.
Unexpected behaviour you saw
Local IP address lookup takes up to 8 seconds.
$ time host 192.168.0.102
102.0.168.192.in-addr.arpa domain name pointer lenovo-gentoo.
102.0.168.192.in-addr.arpa domain name pointer lenovo-gentoo.local.
host 192.168.0.102 0.00s user 0.01s system 0% cpu 7.682 total
Steps to reproduce the problem
Have LLMNR=resolve and MulticastDNS=resolve in your network config file.
Try to do host 192.168.0.102, where 192.168.0.102 is the configured address of the corresponding interface.
Although doing this might seem like a silly thing to do, systemd-resovled synthesizes DNS records for a local hostname (unless you have an /etc/hosts entry for it), and some programs like to resolve the local hostname to IP address and then resolve the IP address back. Python's socket.getfqdn() does this, and it's hit by this problem pretty hard.
By looking at the traffic, it seems that systemd-resolved attempts to resolve the PTR record using the primary DNS server first, and then tries mDNS protocol, which take some time to time out. Yes, it basically asks others about PTR record for its own IP address.
Since the lookup succeeds even though nobody replies, I guess systemd-resolved already synthesizes PTR records for a local addresses. The problem is it still tries to use mDNS protocol, even though (in theory) it knows that the owner of the IP address in question has LLMNR/mDNS set to "resolve only".
We generally synthesize records for the local hostname only as fallback if nothing else is defined. i.e. the name in DNS always takes precedence.
That said, it probably does make sense to skip LLMNR and mDNS for the local hostname, even if we still consult DNS. Right now LLMNR/mDNS/classic DNS come first, local synthesizing last.
That said, it probably does make sense to skip LLMNR and mDNS for the local hostname, even if we still consult DNS. Right now LLMNR/mDNS/classic DNS come first, local synthesizing last.
For some reason, this problem only occurs with reverse lookups. That is, host 192.168.0.102 is slow , but both host lenovo-gentoo and host lenovo-gentoo.local immediately return synthesized records containing IP addresses of all interfaces.
Activity
poettering commentedon Jun 23, 2020
We generally synthesize records for the local hostname only as fallback if nothing else is defined. i.e. the name in DNS always takes precedence.
That said, it probably does make sense to skip LLMNR and mDNS for the local hostname, even if we still consult DNS. Right now LLMNR/mDNS/classic DNS come first, local synthesizing last.
WGH- commentedon Jun 23, 2020
For some reason, this problem only occurs with reverse lookups. That is,
host 192.168.0.102is slow , but bothhost lenovo-gentooandhost lenovo-gentoo.localimmediately return synthesized records containing IP addresses of all interfaces.resolved: let's preferably route reverse lookups for local subnets to…
resolved: let's preferably route reverse lookups for local subnets to…
resolved: let's preferably route reverse lookups for local subnets to…
resolved: let's preferably route reverse lookups for local subnets to…