Skip to content

LLMNR causes 1 second delay resolving DNS RRs for local. & incorrect result (SERVFAIL) #16233

Closed

Description

@yrro

systemd version the issue has been seen with

245

Used distribution

Fedora 32

Expected behaviour you didn't see

resolved should match the behaviour of other DNS resolvers:

$ time host -v -t aaaa local. 192.168.1.1
Trying "local"
Using domain server:
Name: 192.168.1.1
Address: 192.168.1.1#53
Aliases: 

Host local. not found: 3(NXDOMAIN)
Received 23 bytes from 192.168.1.1#53 in 4 ms
Received 23 bytes from 192.168.1.1#53 in 4 ms

real	0m0.030s
user	0m0.016s
sys	0m0.010s

Unexpected behaviour you saw

This takes 1 second and the result is SERVFAIL:

$ time host -v -t SOA local. 
Trying "local"
Host local not found: 2(SERVFAIL)
Received 23 bytes from 127.0.0.53#53 in 815 ms

real	0m0.951s
user	0m0.015s
sys	0m0.020s

Steps to reproduce the problem
/etc/resolv.conf is symlinked to /run/systemd/resolve/stub-resolv.conf and consequently contains 127.0.0.53 as its only nameserver.

I haven't customised resolved.conf on this machine. Consequently MDNS is not enabled on any interface.

$ resolvectl mdns
Global: yes
Link 4 (virbr0-nic): no
Link 3 (virbr0): no
Link 2 (wlp2s0): no

Why this matters

All NSS lookups for MDNS names take 1 second to complete:

$ time getent ahosts foo.local
192.168.1.11    STREAM foo.local
192.168.1.11    DGRAM  
192.168.1.11    RAW    

real	0m1.039s
user	0m0.005s
sys	0m0.005s

This is because Avahi's MDNS modules attempts to detect whether local is a real DNS zone (by doing a SOA lookup for local) before they actually ask Avahi to perform name resolution. Consequently, resolved is consulted, and the 1 second delay occurs for every name lookup.

Whether it matters that the result from resolved is SERVFAIL rather than NXDOMAIN, I don't know. But I think resolved should return NXDOMAIN when the label local is resolved unless it really does know about a local. DNS zone.

Activity

  1. yrro commented on Jun 21, 2020

    @yrro
    ContributorAuthor

    Debug log messages from resolved:

    [1681850.721625] systemd-resolved[2827832]: Got DNS stub UDP query packet for id 46193
    [1681850.773362] systemd-resolved[2827832]: Looking up RR for local IN SOA.
    [1681850.773579] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681850.774285] systemd-resolved[2827832]: Transaction 60074 for <local IN SOA> scope llmnr on wlp2s0/INET6.
    [1681850.774452] systemd-resolved[2827832]: Delaying llmnr transaction for 13379us.
    [1681850.775358] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681850.775511] systemd-resolved[2827832]: Transaction 51637 for <local IN SOA> scope dns on wlp2s0/*.
    [1681850.775631] systemd-resolved[2827832]: Using feature level UDP for transaction 51637.
    [1681850.777043] systemd-resolved[2827832]: Using DNS server 192.168.1.1 for transaction 51637.
    [1681850.777395] systemd-resolved[2827832]: Sending query packet with id 51637.
    [1681850.778118] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681850.778293] systemd-resolved[2827832]: Transaction 6278 for <local IN SOA> scope llmnr on wlp2s0/INET.
    [1681850.778742] systemd-resolved[2827832]: Delaying llmnr transaction for 4355us.
    [1681850.778893] systemd-resolved[2827832]: Processing query...
    [1681850.779091] systemd-resolved[2827832]: Processing incoming packet on transaction 51637 (rcode=NXDOMAIN).
    [1681850.779667] systemd-resolved[2827832]: Transaction 51637 for <local IN SOA> on scope dns on wlp2s0/* now complete with <rcode-failure> from network (unsigned).
    [1681850.779822] systemd-resolved[2827832]: Timeout reached on transaction 60074.
    [1681850.780587] systemd-resolved[2827832]: Retrying transaction 60074.
    [1681850.782584] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681850.784632] systemd-resolved[2827832]: Transaction 60074 for <local IN SOA> scope llmnr on wlp2s0/INET6.
    [1681850.784796] systemd-resolved[2827832]: Sending query packet with id 60074 on interface 2/AF_INET6.
    [1681850.784929] systemd-resolved[2827832]: Timeout reached on transaction 6278.
    [1681850.785045] systemd-resolved[2827832]: Retrying transaction 6278.
    [1681850.785149] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681850.785261] systemd-resolved[2827832]: Transaction 6278 for <local IN SOA> scope llmnr on wlp2s0/INET.
    [1681850.785374] systemd-resolved[2827832]: Sending query packet with id 6278 on interface 2/AF_INET.
    [1681851.036196] systemd-resolved[2827832]: Timeout reached on transaction 60074.
    [1681851.037015] systemd-resolved[2827832]: Retrying transaction 60074.
    [1681851.037649] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681851.041561] systemd-resolved[2827832]: Transaction 60074 for <local IN SOA> scope llmnr on wlp2s0/INET6.
    [1681851.042335] systemd-resolved[2827832]: Sending query packet with id 60074 on interface 2/AF_INET6.
    [1681851.042921] systemd-resolved[2827832]: Timeout reached on transaction 6278.
    [1681851.044940] systemd-resolved[2827832]: Retrying transaction 6278.
    [1681851.045765] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681851.046505] systemd-resolved[2827832]: Transaction 6278 for <local IN SOA> scope llmnr on wlp2s0/INET.
    [1681851.047138] systemd-resolved[2827832]: Sending query packet with id 6278 on interface 2/AF_INET.
    [1681851.283277] systemd-resolved[2827832]: Timeout reached on transaction 60074.
    [1681851.283871] systemd-resolved[2827832]: Retrying transaction 60074.
    [1681851.284311] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681851.284653] systemd-resolved[2827832]: Transaction 60074 for <local IN SOA> scope llmnr on wlp2s0/INET6.
    [1681851.284979] systemd-resolved[2827832]: Sending query packet with id 60074 on interface 2/AF_INET6.
    [1681851.285507] systemd-resolved[2827832]: Timeout reached on transaction 6278.
    [1681851.285904] systemd-resolved[2827832]: Retrying transaction 6278.
    [1681851.289848] systemd-resolved[2827832]: Cache miss for local IN SOA
    [1681851.290874] systemd-resolved[2827832]: Transaction 6278 for <local IN SOA> scope llmnr on wlp2s0/INET.
    [1681851.293312] systemd-resolved[2827832]: Sending query packet with id 6278 on interface 2/AF_INET.
    [1681851.533763] systemd-resolved[2827832]: Timeout reached on transaction 60074.
    [1681851.534399] systemd-resolved[2827832]: Retrying transaction 60074.
    [1681851.534705] systemd-resolved[2827832]: Transaction 60074 for <local IN SOA> on scope llmnr on wlp2s0/INET6 now complete with <not-found> from none (unsigned).
    [1681851.535030] systemd-resolved[2827832]: Timeout reached on transaction 6278.
    [1681851.535550] systemd-resolved[2827832]: Retrying transaction 6278.
    [1681851.535799] systemd-resolved[2827832]: Transaction 6278 for <local IN SOA> on scope llmnr on wlp2s0/INET now complete with <not-found> from none (unsigned).
    [1681851.536015] systemd-resolved[2827832]: Freeing transaction 60074.
    [1681851.539589] systemd-resolved[2827832]: Freeing transaction 51637.
    [1681851.540909] systemd-resolved[2827832]: Sending response packet with id 46193 on interface 1/AF_INET.
    [1681851.541821] systemd-resolved[2827832]: Freeing transaction 6278.
    

    So the delay is caused by LLMNR. A lookup for foo.local does not go via LLMNR, so perhaps a lookup for local itself should also bypass LLMNR?

  2. changed the title [-]1 second delay resolving RRs for local. & incorrect result (`SERVFAIL`)[/-] [+]LLMNR causes 1 second delay resolving DNS RRs for local. & incorrect result (`SERVFAIL`)[/+] on Jun 27, 2020
  3. added a commit that references this issue on Nov 6, 2020
    088648d
  4. added a commit that references this issue on Jan 16, 2021
    5ef4c55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions