skip to content

Why does a Windows host broadcast an LLMNR or NBT-NS query after DNS returns NXDOMAIN?

level: juniorimportance: should knowfreq 46%

answer

  1. the lookup does not stop at NXDOMAIN
  2. one chain, several mechanisms
  3. after DNS there is no server at all
  4. multicast and broadcast, link scope only
  5. first well-formed reply is believed

basics

~20 s

Windows treats name resolution as a chain, not one authority. NXDOMAIN ends only the DNS step; the host then asks every machine on its own link over LLMNR and NBT-NS, and accepts the first reply it gets.

solid answer

~50 s

A Windows resolver tries the configured DNS servers first. `NXDOMAIN` is an authoritative statement that the name does not exist, but it terminates the DNS attempt only — below DNS sit link-local fallbacks: LLMNR on UDP 5355 to a multicast group, NBT-NS on UDP 137 to the subnet broadcast address, and mDNS on UDP 5353 for `.local` names. None of them has a server. The query goes to every host on the segment, any host may answer, and the first well-formed reply wins. The names that reach this path are exactly the ones nobody owns: a mistyped share, a mapped drive pointing at a server decommissioned two years ago, a `wpad` lookup, an old hostname baked into a shortcut. The security point is that this is not an error path or a misconfiguration — it is default behaviour, firing routinely, handing name authority to the segment's peers.

code

text · 9 lines
text
ws-014     -> 10.0.0.53:53       DNS    A? fileserv01.corp.example
10.0.0.53  -> ws-014             DNS    Rcode=NXDOMAIN   (no such name)

ws-014     -> 224.0.0.252:5355   LLMNR  A? "fileserv01"           (multicast, IP TTL=1)
ws-014     -> 10.0.0.255:137     NBT-NS NB? FILESERV01<20>        (subnet broadcast)

10.0.0.91  -> ws-014             LLMNR  response: fileserv01 A 10.0.0.91   (unicast, first reply wins)
ws-014     -> 10.0.0.91:445      TCP    SYN
...

go deeper

for a junior

Recall the chain: cache, hosts file, DNS, then LLMNR and NBT-NS on the local link. Be able to say that NXDOMAIN ends the DNS step only and that the fallback asks peers, not a server.

for a middle

Explain the transports and scope - UDP 5355 multicast, UDP 137 broadcast, UDP 5353 for .local - and why TTL 1 and subnet broadcast confine the whole thing to one segment.

for a senior

Show which names realistically reach this path in a real estate and why the volume is steady rather than incidental. Be ready to say what an answer does and does not give whoever sends it.

for a principal

Frame it as an architectural default rather than a bug: a name service with no authority, enabled everywhere, consulted precisely for names nobody owns. Be able to argue where that default is acceptable.

## What actually happens on the wire A Windows host resolving a short name walks a chain of mechanisms, and DNS is only one link in it. Roughly: the local resolver cache, the `hosts` file, the configured DNS servers (with the connection's search suffixes appended), and then — if all of that produced nothing — a set of **link-local** name protocols that ask the network segment directly. Those fallbacks are: | Protocol | Transport | Destination | Names | |---|---|---|---| | LLMNR | UDP 5355 | multicast `224.0.0.252` / `FF02::1:3` | any single-label name | | NBT-NS | UDP 137 | subnet broadcast | 15-character NetBIOS names plus a service suffix | | mDNS | UDP 5353 | multicast `224.0.0.251` / `FF02::FB` | names under `.local` | The defining property is that **there is no server**. An LLMNR query is not sent to anything that has been designated as an authority; it is thrown at the whole link, and whichever listener replies first is believed. LLMNR queries are sent with an IP TTL of 1 so they cannot be routed, and NBT-NS uses subnet broadcast, which routers do not forward either. That is why the exposure is scoped to the segment: what matters is what is plugged into the same link, not what is reachable across the estate. ## Why NXDOMAIN does not end resolution The intuition that trips people up is treating DNS as *the* name service. It is not; on Windows it is one step of several, and `NXDOMAIN` is a well-formed, truthful answer meaning "the zone I am authoritative for does not contain that name". It says nothing about whether some other mechanism might know the name, so the resolver moves on to the next mechanism. Nothing has gone wrong at this point. The DNS server behaved correctly, the resolver behaved as specified, and no packet anywhere has been forged. ## Which names actually get here Because the fallback fires only after DNS has denied the name, the traffic on this path is made almost entirely of names that **do not exist**: - typos — a user types `\\fileserv01` instead of `\\fileserver01` - stale mapped drives and shortcuts reconnecting to hosts retired long ago - names in old logon scripts and printer configurations - `wpad`, looked up automatically by hosts with proxy auto-detection enabled - `.local` service discovery from applications and printer drivers On a busy user segment this is a continuous trickle, not a rare event, and it needs no user to make a mistake in the moment. ## Why this is a security subject at all Asking a question is harmless; the problem is what the protocols do with the answer. LLMNR, NBT-NS and mDNS carry no authentication, no signature and no concept of who owns a name. Any device that can put a packet on the link — including one with no account in the directory at all, such as a vendor's installed appliance or a managed print controller — may answer. The client accepts the reply and then does what it was always going to do with the name: open a connection to the address it was given. The device that answered has not exploited anything; it simply told the truth-shaped lie that the protocol invites, and the client walked to it. ## Reading a single lookup The code fragment shows one lookup end to end: the DNS question and its authoritative denial, the two link-local queries that follow, an answer from a host on the segment, and the client's own outbound connection to the address it was handed. Note that the DNS exchange and the LLMNR exchange are *different protocols*: nothing was inserted into a DNS cache, and no DNS message was tampered with. ## The same packets, benign In a small office where a printer is discovered over mDNS and nothing else provides that function, these are the intended packets doing their intended job. The protocol is not a bug. Whether it is an exposure depends on who else shares the link and which names the hosts are asking for.

  • Does the host check that the machine answering has any right to that name?
    No. LLMNR, NBT-NS and mDNS carry no authentication, no signature and no ownership registry. The client matches the reply against the outstanding query's name and transaction and accepts it, then caches it briefly. Being on the link is the only qualification a responder needs.
  • Can a host on another subnet answer these queries?
    No. LLMNR multicast is sent with IP TTL 1 and NBT-NS uses subnet broadcast, so routers never forward either. The exposure is link-scoped, which is why an unmanaged device plugged into the user segment matters far more here than anything reachable across a routed estate.
  • Which names realistically end up on this path in a corporate estate?
    Names DNS does not hold: mistyped hosts and shares, stale mapped drives and shortcuts pointing at decommissioned servers, hostnames left in old logon scripts, `wpad` from proxy auto-detection, and `.local` service discovery from printer and media software.

Asking DNS is asking the registry office. Falling back to LLMNR is stepping into the corridor, shouting the name, and trusting whoever shouts back first.

saying these in an interview costs you the question

  • Believes NXDOMAIN ends name resolution on the host
  • Thinks the fallback query still goes to a DNS server
  • Calls the fallback a misconfiguration rather than default behaviour
  • Assumes only domain-joined machines can answer
  • Thinks a router can forward an LLMNR query to another subnet

context