The Order of Name Resolution on Windows — hosts, the DNS Cache, LLMNR/mDNS, and DoH

· Updated: · · Windows, DNS, Name Resolution, Networking, Bug Investigation, PowerShell, TCP/IP, Information Systems

Revision history (first version, published Sep 4, 2026)
First published
Cite this article(DOI: 10.5281/zenodo.22640300)

This article is archived on Zenodo. Below are both the DOI that always resolves to the latest version and the DOI pinned to the version you are reading.

Go Komura (2026). The Order of Name Resolution on Windows — hosts, the DNS Cache, LLMNR/mDNS, and DoH. KomuraSoft LLC. https://doi.org/10.5281/zenodo.22640300 https://comcomponent.com/en/blog/windows-name-resolution-order-hosts-dns-cache-llmnr-mdns-doh/

DOI (latest version)
10.5281/zenodo.22640300
DOI (this version)
10.5281/zenodo.22640301

“The settings are the same, but only this PC cannot reach the internal server.” “It opens in the browser, but the business app fails at name resolution.” “I put it in hosts and it has no effect.”

When investigating problems like these, the first thing to establish is which mechanism is answering for that name. Windows has several paths: the cache, hosts, the DNS server, LLMNR, NetBIOS, and mDNS, and some apps use a path of their own that is separate from Windows.

This article first gives the overall picture, sorts out the shape of a name and the differences between the paths, and then moves on to the actual isolation procedure. If you need to investigate right now, jump to the relevant section from the following table.

Your problem What to check first Where to read
hosts has no effect / only some PCs return an old IP The contents of the cache and the path taken by the tool you used Cache and hosts, Step 2
A short name such as app01 fails on only some PCs Suffix completion, and whether LLMNR and NetBT are available Shape of the name, The typical single-label-name case
The result changes when connected to VPN The priority among multiple NICs and the NRPT Multiple NICs, NRPT
It connects after a wait of several seconds An unresponsive DNS server and the retransmission timing Timeouts
The browser and the business app get different results The built-in resolver, Secure DNS, the proxy Where the app enters, DoH in the browser
You do not know where to start Start from the shape of the name and compare results with the path restricted Isolation procedure

Prerequisites for This Article

Item Details
Intended readers IT staff investigating “the name does not resolve” and “only some PCs cannot connect”, and Windows app developers who design and maintain the communication of business apps
Background knowledge The basics of IP addresses and DNS (A records, FQDNs), and the ability to run PowerShell cmdlets with administrator rights
Target environment Windows 10 / Windows 11. The DoH section requires Windows 11 or Windows Server 2022 or later.1 The check commands use the DnsClient module (Windows 8 / Windows Server 2012 or later)2
Out of scope Configuration and failures on the DNS server side (zones, forwarders, and recursion in Windows Server DNS). Deployment steps for Zero Trust DNS (ZTDNS)

The packet capture article covers the packets that flow on the wire, and the proxy article covers “whose proxy settings get read”. This article covers the step before those: “where did the destination IP address come from”, organized on the basis of Microsoft’s primary sources.

1. The Bottom Line First

There are three things to remember.

  • Windows name resolution does not always proceed down a single queue in order. The cache and hosts come first, but for a single-label name, DNS and LLMNR/NetBT run in parallel by default.34
  • The same name gives different results when the PC’s settings and the app’s path differ. Think of suffixes, VPN, the NRPT, and the browser’s built-in resolver separately.567
  • In an investigation, restrict the path in use and compare the results. Separate cache, DNS, and link-local with the switches of Resolve-DnsName, then confirm with a settings diff against a working PC and with a capture.8

Use the following diagram as the overall map.

Name resolution is a stack of layersA name resolution request goes from the app's API to the DNS Client service; the cache and hosts are checked first, then the DNS server, and for single-label names only, LLMNR and NetBIOS (in parallel with DNS by default) are tried. For .local names, mDNS is an additional path alongside the configured DNS. The browser has its own resolver outside this queueif absentif absent, single-label name (parallel with DNS by default).local name (additional path)own resolver, DoHApp (getaddrinfo)DNS Client serviceCache (including hosts)Query the DNS serverLLMNR / NetBIOSmDNSBrowserSeparate path

The cache is checked first; beyond it, DNS and, for single-label names, LLMNR and NetBIOS run in parallel. The browser has a separate path.

Below, “which layer answers” is covered in Chapters 3 to 5, “how the query is sent” in Chapter 6, and “how to verify” in Chapters 7 and 8. DoH is a feature that switches the transport to the DNS server to HTTPS; it does not replace the order of hosts, cache, and NRPT.9

In the diagram a solid line marks a relation that always holds and a dashed line marks a conditional one (the conditions are given per relation on the detail page). The full list of relations (48 in total, with evidence and certainty) and the definitions of the main concepts are collected on the knowledge map detail page (in Japanese). Data: JSON-LD / Turtle

2. “Name Resolution” Is Not a Single Operation

All the App Gets Back Is an Address or an Error

When an app connects using a name such as www.example.com, Winsock’s getaddrinfo (the Unicode version is GetAddrInfoW) is called. For the NS_DNS namespace, this function converts the name to an address through DNS, the local hosts file, and other mechanisms. If several namespace providers respond, it aggregates their responses and returns them.10

In other words, from the result the app receives, you cannot tell which layer answered.

.NET’s Dns.GetHostAddresses also uses getaddrinfo on Windows. For a host listed in hosts, it returns that address without querying a DNS server. HttpClient runs on top of this Dns class as well, so a .NET app that connects directly to its destination inherits the Windows name resolution order.11

Through an HTTP proxy, the name that gets resolved changes. What is resolved locally is the proxy’s name; the destination name is resolved on the proxy side. In that case the local hosts, cache, suffixes, and NRPT play no part in resolving the destination. Which proxy settings are used is covered in the proxy article.

2.1 The DNS Client Service Decides the Order

Working beneath getaddrinfo is the DNS Client service (service name Dnscache). Microsoft’s documentation describes the basic order as follows.3

  1. Check the cache.
  2. Check the hosts file.
  3. Query the DNS server.

Because the contents of hosts are loaded into the cache when the service starts, this article treats the first two together as layer 1, “cache and hosts”.5

Beyond that, the path branches depending on the name and the policies.

Layer Role Caution when reading the order
Layer 1: cache and hosts Returns an answer held inside the PC If an answer is found here, the DNS server is not asked
Layer 2: DNS server Obtains an answer by querying DNS Suffixes, multiple NICs, the NRPT, and so on are involved
Layer 3: LLMNR and NetBT Resolves single-label names by other means as well Parallel with layer 2 by default. It becomes sequential after a DNS failure only when the optimization has been disabled

The default “smart multi-homed name resolution” sends DNS, LLMNR, and NetBT queries to all networks in parallel. Which response is adopted is decided by the rules in Sections 4.3 and 5.2.4

Therefore, “when the query is sent” and “the priority given to the answers that come back” are two different matters. Seeing LLMNR or NetBT in a capture does not by itself mean “DNS failed”. The “three layers” in this article are a division for explanation; they do not mean that the layers always run sequentially in time order.

2.2 Things Outside the Queue

The two that are especially easy to confuse are these.

Tool or app How it differs from the Windows path Caution during an investigation
nslookup Does not use the OS resolver; bypasses the cache, hosts, and the NRPT and queries the first DNS server directly123 It is no surprise when its result differs from ping or the business app
Microsoft Edge Uses its built-in DNS client by default. DoH is also always handled by the built-in resolver7 “It opens in the browser” is not proof that OS name resolution is healthy

Using Edge’s built-in client does not by itself mean that the DNS server changes. Section 6.2 treats it separately from the Secure DNS setting that selects a different provider.

3. Layer 1 — The Cache and hosts

What you want to know at this layer is what answers remain inside the PC. The cache holds not only correct answers but also stale answers and “the name does not exist” answers.

3.1 hosts Is Loaded Into the Cache

The hosts file is at C:\Windows\System32\drivers\etc\hosts. When the DNS Client service starts, its name-to-IP-address mappings are loaded into the resolver cache. Records obtained from DNS queries are held in the same cache for their TTL (time to live).5

ipconfig /displaydns shows both the entries loaded from hosts and the entries obtained by recent DNS queries.13 In Microsoft’s own example, if you put contoso.com in hosts, Resolve-DnsName contoso.com returns that address and no DNS traffic flows.3

How to Read the Absence of DNS Packets

If you resolve an FQDN without DoH or DoT, name resolution succeeds, and there is no query on port 53, the cache or hosts is presumably answering. First, however, rule out the following other paths.

Name or setting Traffic to check besides port 53
.local name mDNS (UDP 5353)
Single-label name LLMNR (5355), the NetBT name service (UDP 137)
DoH enabled HTTPS (443)
DoT enabled TLS (853)

Do not conclude “cache” just because “there is nothing on port 53”; look at the paths that could be in use as well. A single line of test hosts left on a development machine can send an investigation astray.

Editing hosts requires administrator rights, and security products may detect the change. A design that makes business app operations depend on hosts should be avoided.

3.2 Negative Responses Are Cached Too

“Not found” is also one of the answers that get cached. The DNS client stores negative responses as well as positive ones.5

If ipconfig /displaydns shows “Name does not exist” for the target name, a negative response from the DNS server remains on the client. Microsoft’s procedure tells you to discard it with ipconfig /flushdns.1413

The retention time of the negative cache is MaxNegativeCacheTtl under HKLM\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters, and the default is 5 seconds.15 This is why a PC can keep returning failures for a few seconds even right after a record has been added to DNS.

3.3 TTL and “Only Some PCs Are Stale”

Positive responses also remain for their TTL. A PC that resolved the name before the server’s IP address was changed keeps using the old answer, while a PC that resolves it for the first time after the change gets the new one. Even with the same DNS server, the result differs when the time of the lookup differs.5

Clear-DnsClientCache behaves the same as ipconfig /flushdns and deletes the entire contents of the cache, including negative responses.16 With Get-DnsClientCache, you can retrieve the cache as objects and check the record type and the remaining TTL.17

# Is a specific name in the cache, and how many seconds of TTL remain?
Get-DnsClientCache -Entry 'app01.corp.example.com' |
    Select-Object Entry, Type, Status, TimeToLive, Data

# Check the contents of hosts and the cache together
ipconfig /displaydns | Select-String -Pattern 'app01' -Context 0,6

# Discard the cache (including negative responses)
Clear-DnsClientCache

If an answer is found at layer 1, this lookup is decided before it reaches the DNS server. However, the possibility remains that a wrong answer was originally learned from the DNS server. Do not stop at clearing it; also check the answer obtained afresh in Step 3 of Chapter 8.

4. Layer 2 — Querying the DNS Server

If layer 1 has no answer, resolution proceeds to DNS. Here, think separately about which name is sent, to which server, and at what timing.

4.1 Single-Label Names and Suffixes

First, check the shape of the name the app passed.5

Shape of the name Example How it is sent to DNS
FQDN with a trailing dot (absolute name) www.contoso.com. Sent as is
Contains a dot but has no trailing dot www.contoso.com By default, sent with a trailing dot appended. If the policy that allows suffix appending for multi-label names is enabled, suffixes are tried as well4
Single-label name without a dot www Completed with the PC’s suffix settings and then sent

A suffix is the domain part appended after a short name. Appending corp.example.com to app01 makes the queried name app01.corp.example.com.

When a Search List Exists

Suffixes from the DNS suffix search list are appended in order from the top, and the name is sent with a trailing dot. Once a search list is configured, only that list is used. The primary suffix, connection-specific suffixes, and name devolution are not used.18

When There Is No Search List

The primary DNS suffix is appended. If name devolution is enabled, the leftmost label is dropped after each failure and the name is tried again; for example, from www.test.contoso.com to www.contoso.com. If an adapter has a connection-specific DNS suffix, that is appended and sent too.5

For this reason, the same server01 expands differently in an environment where Group Policy distributes a search list and in an environment where domain membership supplies a primary suffix.

A Long List Also Increases the Wait

If the correct suffix is near the end of the list, the query time accumulates until it is reached. Microsoft also explains this delay with an example that tries six suffixes. To try only one specific expansion, append a trailing dot, as in internal.contoso.com..3

# Global settings: search list and devolution
Get-DnsClientGlobalSetting

# Per interface: connection-specific suffix and registration settings
Get-DnsClient | Select-Object InterfaceAlias, ConnectionSpecificSuffix, UseSuffixWhenRegistering

# DNS servers per interface (both IPv4 and IPv6)
Get-DnsClientServerAddress | Where-Object ServerAddresses | Select-Object InterfaceAlias, AddressFamily, ServerAddresses

Get-DnsClientGlobalSetting returns the global settings such as the search list and whether and to what level devolution is enabled; Get-DnsClient returns the per-interface settings.1920

4.2 The Order of Multiple DNS Servers and Timeouts

When “it does not fail, but there is a wait of several seconds”, suspect retransmissions to an unresponsive DNS server. For the DNS servers configured on a single NIC, the default retransmission timing lines up as follows.21

Time from start 1 server 2 servers 3 or more servers
0 s Query the server To the 1st To the 1st
1 s Retransmit To the 2nd To the 2nd
2 s Retransmit Retransmit to the 2nd To the 3rd
4 s Retransmit To all servers at once To all servers at once
8 s Retransmit To all servers at once To all servers at once
10 s Give up Give up Give up

This is the table for the case where there is no response. In particular, do not confuse the following two.

Server’s reaction Is the next server tried? How to read it
No response Yes A retransmission and timeout problem
A negative response saying “the name does not exist” It stops there An answer saying the name does not exist has been received

When “we stopped one of them but it does not switch over”, if a server holding an old zone keeps running and returns negative responses, resolution does not move on to the next server.21

The Fourth and Later Servers Are Not Reached Until 4 Seconds In

If the server that can respond is fourth or later in the list, at least 4 seconds pass after the first query. If the app’s deadline is shorter than that, it fails at the name resolution stage. To get the query out sooner, you would have to move that server into the first three, but the root fix is to repair the unreachable servers ahead of it, or remove them from the settings. Review the app-side timeout as well.21

In Microsoft’s example, too, a configuration in which only one of four servers is reachable takes about 4 seconds to complete. You can measure the elapsed time with Measure-Command, and the same document treats under 1 second as acceptable.3

# Ask a specific server directly, DNS only, and get the elapsed time in milliseconds
(Measure-Command {
    Resolve-DnsName -Name 'app01.corp.example.com' -Server 10.0.1.2 -DnsOnly
}).TotalMilliseconds

Because this command pins the server, it measures the response time of that server alone. The delay until the fourth entry in the list is reached is checked with a query without -Server, or with a capture of that query.

Note that the DNS client moves faster-responding servers up, remembers unresponsive servers, and retries them periodically. The initial timeout is also adjusted within a range of 25 to 1,000 milliseconds based on past performance. The table above is the default skeleton, which is why actual measurements deviate from it.5

4.3 Multiple NICs and “Smart Multi-Homed Name Resolution”

On a PC with both wired and Wi-Fi, or a PC to which a VPN adapter is added, check not only the list of DNS servers but also the querying across networks and the selection of the response.

Retransmission to Multiple Adapters

In Microsoft’s query procedure, the query goes to the first DNS server of the preferred adapter, with a 1-second wait. If there is no response, it goes to the first server of every adapter still in the candidate set, with a 2-second wait, and after that to all servers of all adapters, with waits of 2, 4, and 8 seconds. When a server on one adapter returns a negative response, the other servers of that adapter are removed from the candidates.5

The Policy That Controls Parallel Querying

The Group Policy setting “Turn off smart multi-homed name resolution” controls the following behavior.4

Policy Behavior
Default (not configured) DNS, LLMNR, and NetBT are queried across all networks in parallel. If several positive responses arrive, the one from the network highest in the binding order is adopted
Enabled Stops the optimization. DNS is tried on all networks first; if that fails, LLMNR; if that also fails, NetBT, in sequence

Because the policy is named “Turn off”, note that enabling the policy disables the optimization.

An Example Where VPN Changes the Result

When an internal name is queried, the DNS on the VPN side returns the internal address, and the DNS on the home router side can also return a different positive response: a public address under the same domain name as the internal one, or the address of an advertising page substituted for a non-existent name, for example.

With two positive responses, the adoption is decided by the binding order. On current Windows, this priority is determined by the interface metric; the smaller the InterfaceMetric shown by Get-NetIPInterface, the higher the priority. Differences in this order from PC to PC become differences in the result.22

If, on the other hand, the home side returns a negative response, that adapter is removed from the candidates and the VPN side’s answer is used.5 VPN products distribute the NRPT or “Turn off smart multi-homed name resolution” precisely to control these differences.

4.4 NRPT — Changing Where Queries Go per Namespace

The NRPT (Name Resolution Policy Table) is a table that specifies, per namespace such as .corp.contoso.com, which DNS servers to use and the DirectAccess and DNSSEC settings. DirectAccess and Always On VPN profiles write rules into it to produce behavior such as “send only internal names to the internal DNS”.236

Get-DnsClientNrptPolicy -Effective shows the rules actually in effect.

# The NRPT rules actually in effect
Get-DnsClientNrptPolicy -Effective

# Show only the rules for a specific namespace. -Namespace only filters on the Namespace attribute; it does not match against a name.
# Passing 'app01.corp.example.com' does not return the suffix rule for '.corp.example.com'.
# To find which rule applies to a name, enumerate the rules and match them yourself, as in Step 4 of Chapter 8
Get-DnsClientNrptPolicy -Effective -Namespace '.corp.example.com'

The NRPT applies only to apps that use the Windows DNS API. Apps with their own DNS implementation bypass that path. The VPNv2 CSP documentation cites nslookup as an example and requires Resolve-DnsName for checking the NRPT. The browser’s built-in resolver and DoH are also outside the Windows DNS API.6

5. Layer 3 — The Escape Routes for Single-Label Names: LLMNR, NetBIOS, and Then mDNS

5.1 How the Three Protocols Differ

LLMNR and NetBIOS over TCP/IP (NetBT) are alternative means of resolving a single-label name such as app01. By default they run in parallel with DNS, and a link-local response can be adopted even when DNS returns a positive response. They become sequential after a DNS failure only when smart multi-homed name resolution has been turned off.4

mDNS is separate from these; it is an additional path for .local names. It is not a catch-all that kicks in after DNS resolution of a single-label name has failed.24

Protocol Port Reach Position
LLMNR Multicast on UDP 5355. TCP 5355 is for unicast retransmission2526 The link within the same subnet Secondary name resolution that works without DNS configured4
mDNS Multicast on UDP 535324 The local network that multicast reaches Resolution of .local names. The method Microsoft has chosen as the axis going forward27
NetBT The name service on UDP 13728 Broadcast, or a query to a WINS server29 Legacy. Migration from WINS to DNS is recommended30

Even for .local, Do Not Skip Checking DNS

.local does not become mDNS-only. If the Active Directory domain is something like corp.local, that name continues to be resolved by the configured DNS servers and the NRPT as well. RFC 6762 also allows coexistence with unicast DNS. When investigating .local names, check the DNS and VPN policies too.24

NetBT Depends on Whether WINS Exists and on the Node Type

Node type Name resolution method
B-node Broadcast only
P-node WINS queries only
M-node Broadcast, then WINS
H-node WINS, then broadcast

Without WINS configured the default is B-node; with even one WINS server configured, the default is H-node.29 LLMNR and NetBT broadcasts do not cross subnets, but queries to WINS are unicast and therefore can.

nbtstat -c shows the NetBIOS name cache, and nbtstat -R purges the cache and reloads LMHOSTS.31

5.2 Which One Takes Priority

Which response takes priority after the parallel queries is also governed by policy.4

Condition Priority of responses for a single-label name
Default, on a network that is not a domain network Link-local responses from LLMNR or NetBT take priority over DNS
A domain network DNS responses take priority
“Turn off smart protocol reordering” enabled DNS, then LLMNR, then NetBT, on every network

On home or public networks, the answer from a nearby device with the same name can take priority over DNS. Here too, it matters to read the response priority separately from whether the queries are sequential or parallel.

5.3 Microsoft’s Direction: Aligning on mDNS

In April 2022, Microsoft announced a direction of aligning on mDNS and gradually ramping down NetBIOS name resolution and LLMNR.27 Old and insecure device discovery protocols such as Computer Browser have been deprecated as well.32 Designs that supplement single-label names with multicast or broadcast are on their way out.

Microsoft’s information on the LLMNR vulnerability lists, as workarounds, blocking TCP/UDP 5355 and enabling the Group Policy setting “Turn off multicast name resolution”. It also states that as a consequence the computer may become invisible to other computers.25 Enabling this policy disables LLMNR on all adapters of the DNS client.4

The decision to disable them is itself correct, but a replacement for the path that disappears has to be provided in DNS. For devices not registered in DNS, register their A records or enable dynamic registration through DHCP, and change the destinations to FQDNs. Devices that support mDNS can use .local names, but the reach is limited to where multicast gets through.

5.4 The Typical “Only Some PCs Cannot Connect” Case: Single-Label Names

When a configuration file or shortcut contains \\fileserver01 or http://app01/, the same name produces the following differences.

PC environment What can happen
Domain-joined desktop The suffix completes it to app01.corp.example.com, and the internal DNS resolves it
Laptop over VPN Completion depends on the VPN profile. If it is not completed and there is no target on the same subnet, LLMNR and NetBT come up empty
Office on another subnet Without a DNS registration, LLMNR and NetBT broadcasts do not reach it. If there is a WINS registration, however, it may still resolve2930
PC with both LLMNR and NetBT disabled A name that is not in DNS cannot be resolved. If only LLMNR is disabled, there is still room for NetBT or WINS to resolve it

What Resolve-DnsName app01 -LlmnrOnly tells you is “whether it can be resolved through LLMNR”. It does not tell you where the answer adopted in everyday queries came from. Comparison with the result without switches, and captures, are done in Step 5 of Chapter 8.8

The Root Fix Is FQDNs and DNS Registration

Change destinations that depend on single-label names to FQDNs, and consolidate name resolution on DNS.

SMB2 and later connect directly on TCP 445 and do not use NetBIOS sessions.33 That, however, is a matter of transport. At the stage of resolving the name in a destination such as \\fileserver01\share, LLMNR or NetBT may be used. Specify the FQDN, as in \\fileserver01.corp.example.com\share, to remove the dependency on the single-label-name path.

Some cautions remain even with FQDNs, though. An FQDN without a trailing dot is also tried with suffixes if the policy that appends suffixes to multi-label names is enabled. A name ending in .local may use mDNS alongside DNS. The form that pins the name unconditionally is the absolute name with a trailing dot. The premise for treating “an FQDN is pinned to DNS” as true in practice is that the policy above is disabled and that the internal domain name does not use .local.

6. The Transport to the DNS Server — DoH Does Not Change the Order

6.1 DoH on Windows 11 / Windows Server 2022

Windows DoH is a feature that sends queries to the DNS server over HTTPS. It is integrated with the existing hosts, cache, and NRPT, and with per-adapter and per-profile resolver settings; it does not replace the order described in Chapters 3 and 4.9

The Windows 11 DNS client supports DoH, and newer versions also support DoT (DNS over TLS). Microsoft’s description, however, does not state which versions support DoT, so it is not guaranteed to be available on every environment this article assumes. The following covers DoH.9

First, Check the List of Known DoH Servers

Unless DDR is enabled, only servers in the list of known DoH servers can be used. The default list contains Cloudflare, Google, and Quad9, and it can be checked with Get-DnsClientDohServerAddress. For an internal DNS server and the like, register a DoH template together with the fallback and auto-upgrade settings.134

# The list of known DoH servers
Get-DnsClientDohServerAddress

# Register the internal DNS server as a DoH server (no plaintext fallback, with auto-upgrade)
Add-DnsClientDohServerAddress -ServerAddress '10.0.1.2' `
    -DohTemplate 'https://dns.corp.example.com/dns-query' `
    -AllowFallbackToUdp $false -AutoUpgrade $true

Registration is also possible with netsh dnsclient add encryption. The global netsh dnsclient set global doh=yes|no|auto is a setting separate from the per-server autoupgrade.35

Global setting Meaning
doh=no Prohibit DoH
doh=yes Allow DoH according to the server and adapter settings
doh=auto Automatically force DoH for queries to known DoH servers

auto alone does not prohibit falling back to plaintext. Whether to fall back to UDP on failure is decided separately by the per-server udpfallback, or -AllowFallbackToUdp in PowerShell. To restrict resolution to encrypted transport only, disable the fallback as well.35

With DDR Enabled, There Is a Dynamic Discovery Path Too

On versions that support DDR (Discovery of Designated Resolvers), a resolver configured in plaintext can advertise its encrypted DNS endpoints. Because the connection can be upgraded to encryption without a registration in the static list, you cannot say “it is not in the list, so it is not DoH”.35

For DDR to work, both the global netsh dnsclient set global ddr=yes and the per-adapter set interface <name> ddr=yes are required. Whether to fall back to plaintext when encrypted resolution obtained through DDR fails is decided by ddrfallback, which is disabled by default.

In an investigation, besides the known list, check netsh dnsclient show global and netsh dnsclient show state, and the values set with set interface on adapters that have DNS servers. The show subcommands defined in the documentation are encryption, global, and state; there is no adapter-specific show subcommand.35

Separate “Allow”, “Require”, and Falling Back to Plaintext

In the Settings app, set the DNS settings to manual; “Preferred DNS encryption” can be chosen only when the preferred DNS server is in the known list. There are three options.1

Option in the Settings app Behavior
Encrypted only (DNS over HTTPS) Use encryption only
Encrypted preferred, unencrypted allowed On DoH failure, fall back to plaintext without notification
Unencrypted only Send in plaintext

The Group Policy setting “Configure DNS over HTTPS (DoH) name resolution” has Allow, Prohibit, and Require. With Allow, DoH is used when, in addition to a registration in the known list, conditions such as auto-upgrade, the adapter’s encryption setting, or the global doh=auto are met. With “Require”, name resolution itself fails against servers that do not support DoH.135

Do not apply “Require DoH” to domain-joined PCs. Microsoft warns about this explicitly. Active Directory Domain Services depends heavily on DNS, and the DNS Server service that ships with Windows Server does not support DoH queries.1

In a Capture, Read the Settings and the Actual Traffic Separately

Queries actually sent over DoH go inside TLS on port 443 rather than UDP 53. Even with “Allow DoH”, however, queries to servers not in the known list, and fallbacks after an encryption failure, flow in plaintext. Having DoH configured does not make port 53 traffic disappear.

If no DNS queries are visible, check DoH and DoT (port 853) in addition to hosts and the cache. For how to capture, see the packet capture article.

6.2 DoH in the Browser Is Separate From the OS

Edge’s built-in DNS client and the change of query destination through Secure DNS are easier to understand when split into two stages.

Setting Who queries, and whom
Default built-in DNS client Edge queries instead of the OS DNS client. The DNS server used does not itself change
Secure DNS using the current provider Queries the current provider with encryption. On failure, retries in plaintext
Secure DNS with a different provider chosen Queries the chosen DoH resolver. Does not fall back to plaintext on failure

The built-in client is controlled by BuiltInDnsClientEnabled, and DoH queries are always made by the built-in resolver.7 Secure DNS is disabled by default on organization-managed PCs and is configured with DnsOverHttpsMode (off / automatic / secure) and DnsOverHttpsTemplates.3637

An Edge that has a different provider chosen may resolve external sites but fail to resolve names known only to the internal DNS. Conversely, Edge alone may still open pages when the OS DNS is unhealthy. If it stays with the current provider, the query destination does not change.

The conclusion is: do not treat the browser’s success and the business app’s success as evidence about the same path. Check the OS path with Resolve-DnsName or ping.

7. Which Path Does the App Take?

Before choosing the tools for an investigation, align the path you are looking at.

Call Path taken hosts Cache NRPT LLMNR/NetBT
getaddrinfo / Dns.GetHostAddresses / HttpClient (direct connection)1011 The OS DNS Client service. An HttpClient going through a proxy resolves only the proxy name locally; the proxy resolves the destination Checked Checked Applies Used for single-label names (parallel with DNS by default; sequential after failure only with the optimization turned off)
ping The OS DNS Client service Checked Checked Applies Used for single-label names (parallel with DNS by default; sequential after failure only with the optimization turned off)
Resolve-DnsName8 The OS DNS Client service (the layer can be chosen with switches) Can be excluded with -NoHostsFile Restricted with -CacheOnly Applies Can be excluded with -DnsOnly
nslookup123 Directly to the first DNS server Not checked Not checked Does not apply Not used
Microsoft Edge (default)76 The built-in DNS client (does not go through the OS DNS client) Separate from the OS path Separate from the OS cache Does not apply (outside the Windows DNS API) Separate from the OS path

The main switches of Resolve-DnsName, organized by investigation purpose, are as follows.8

What you want to check Switch
Whether the local cache alone produces an answer -CacheOnly
Try it with hosts excluded -NoHostsFile
Use only the DNS protocol, without sending LLMNR or NetBIOS -DnsOnly
Ask a specific DNS server -Server
Try LLMNR only -LlmnrOnly
Try LLMNR or NetBIOS only -LlmnrNetbiosOnly
Allow falling back to NetBIOS when DNS fails -NetbiosFallback
Choose the record type -Type. The default, A_AAAA, asks for both A and AAAA

7.1 A and AAAA: IPv6 Comes Back First

Even when name resolution succeeds, the address selection that follows can make the connection slow.

The DNS client queries both A (IPv4) and AAAA (IPv6). In a capture, too, both queries appear as a pair.3 After the answers come back, getaddrinfo and the connecting stack choose the address to use. Windows Vista and later use the RFC 3484 prefix table, and by default prefer IPv6 global unicast over IPv4.38

However, an AAAA answer alone does not mean an IPv6 connection is always attempted. Destination selection first discards unusable destinations, such as those with no IPv6 source address or route, and then orders the candidates.39

The problem arises in environments where an IPv6 source address and route appear to exist but do not actually work. Name resolution succeeds, yet time is lost on the connection. Whether IPv6 was really attempted is confirmed not from the DNS response alone but from connection logs or a capture.

Microsoft does not recommend disabling IPv6 as the remedy, because some Windows components stop working. Instead, it describes setting DisabledComponents to 0x20 to prefer IPv4 in the prefix policy.38 The case where localhost resolves to ::1 and conflicts with an investigation that assumed 127.0.0.1 is also covered in the packet capture article.

8. The Isolation Procedure — Peel the Layers Off From the Top

On the failing PC, run the following in order. Each command exists to restrict the path, and its success alone does not prove the path taken in everyday resolution. Combine the comparison of results with the capture at the end.

Step What to check
1 The shape of the name the app passed
2 The answer from the cache and hosts
3 The DNS result with hosts, LLMNR, and NetBIOS excluded
4 The result from each DNS server on the actual resolution path
5 Resolution of the single-label name through LLMNR and NetBT
6 The settings diff between a working PC and a failing PC
7 Whether packets went out, and what came back

Step 1: Check the Shape of the Name

Check, in a log or a configuration file, the name the app actually passes. The path changes depending on whether it is a single-label name, ends in .local, or has a trailing dot. For a short name such as http://app01/, start from the completion in Section 4.1 and the per-PC differences in Section 5.4.

Step 2: Can It Be Resolved From the Cache and hosts Alone?

Resolve-DnsName -Name 'app01.corp.example.com' -CacheOnly
Get-DnsClientCache -Entry 'app01.corp.example.com'
Get-Content "$env:SystemRoot\System32\drivers\etc\hosts" | Select-String -Pattern 'app01'
Result Reading and the next check
The correct answer comes back This time the answer is decided before it reaches the DNS server
A stale or wrong answer comes back If it is hosts, fix that line. If it is the cache, clear it and then check the answer obtained afresh in Step 3
“Name does not exist” Negative cache. Run Clear-DnsClientCache, then go to Step 3
No answer Possibly an ordinary cache miss. Go to Step 3

-CacheOnly only restricts this lookup to the local cache. If a wrong answer was learned from the DNS server, the same value comes back after clearing. The fact that it was in the cache is not proof that the DNS server is unrelated.8

Step 3: Can It Be Resolved Through DNS Alone?

# Exclude hosts, send no LLMNR/NetBIOS, and query only the configured DNS servers
Resolve-DnsName -Name 'app01.corp.example.com' -NoHostsFile -DnsOnly

If Step 2 had no answer and this step merely succeeds, it is usually an ordinary cache miss. You can call it a cache or hosts problem only when Step 2 showed a stale answer, a wrong answer, or a negative cache entry.

If this step fails too, investigate the route to the DNS server, the server side, and the client-side policies. Before proceeding to Step 4, check the following.

  • Get-DnsClientNrptPolicy -Effective: is there a rule that directs the name to a different DNS server?
  • Get-DnsClientDohServerAddress and the DoH Group Policy: is “Require DoH” set against a server that does not support it?

If there is an NRPT, the target servers in Step 4 change. If “Require DoH” is the cause, only name resolution fails while the route and the server are both healthy. Finish the checks in Sections 4.4 and 6.1 first.

Step 4: Ask Each Server Directly

Collect the DNS servers of the connected adapters, and if an NRPT rule applies to the target name, replace them with the servers of that rule. Include DNS servers configured only for IPv6 as well.

$name = 'app01.corp.example.com'
# Collect the DNS servers of the connected interfaces from both IPv4 and IPv6.
# Servers left in the settings of a disconnected VPN or virtual switch are not part of the current resolution path, so exclude them (do not miss servers configured only for IPv6)
$connected = @((Get-NetIPInterface -ConnectionState Connected).ifIndex | Select-Object -Unique)
$servers = @((Get-DnsClientServerAddress |
    Where-Object { $_.ServerAddresses -and ($connected -contains $_.InterfaceIndex) }).ServerAddresses)
# The servers of the NRPT rule that applies to this name (written by Always On VPN or DirectAccess) do not appear in the adapter settings, so pick them from the effective policy.
# The -Namespace parameter of Get-DnsClientNrptPolicy only filters on the rule's Namespace attribute; it does not match against the name.
# So match the Any rule (.), suffix rules (leading dot; apply to the namespace itself and child domains), FQDN rules, and prefix rules (the host name part; wildcards such as web* are allowed) yourself,
# and adopt the more specific (longer) rule. The Any rule is the shortest, so it is chosen only when no other rule matches
# Namespace is a set of strings (displayed as Namespace : {.corp.example.com}), so expand the elements of each rule for matching and order by the length of the matched namespace
# For an absolute name with a trailing dot (app01.corp.example.com.), strip the dot only for matching. Pass the original $name to Resolve-DnsName
$matchName = $name.TrimEnd('.')
$label = $matchName.Split('.')[0]
$matched = foreach ($policy in @(Get-DnsClientNrptPolicy -Effective)) {
    foreach ($ns in @($policy.Namespace)) {
        if (-not $ns) { continue }
        $hit = if ($ns -eq '.') { $true }
               elseif ($ns.StartsWith('.')) { $matchName.Equals($ns.TrimStart('.'), [System.StringComparison]::OrdinalIgnoreCase) -or $matchName.EndsWith($ns, [System.StringComparison]::OrdinalIgnoreCase) }
               elseif ($ns.Contains('.')) { $matchName.Equals($ns, [System.StringComparison]::OrdinalIgnoreCase) }
               else { $label -like $ns }
        if ($hit) { [pscustomobject]@{ Namespace = $ns; Policy = $policy } }
    }
}
$rule = $matched | Sort-Object { $_.Namespace.Length } -Descending | Select-Object -First 1
$policyServers = @()
if ($rule) { $policyServers = @(@($rule.Policy.NameServers) + @($rule.Policy.DirectAccessDnsServers) | Where-Object { $_ }) }
if ($policyServers.Count -gt 0) {
    # If the NRPT specifies servers for this namespace, the query in Step 3 goes to those servers. The adapter's servers are outside the path, so replace them
    $servers = $policyServers
}
$servers = $servers | Where-Object { $_ } | Select-Object -Unique
foreach ($server in $servers) {
    $sw = [System.Diagnostics.Stopwatch]::StartNew()
    try {
        $r = Resolve-DnsName -Name $name -Server $server -DnsOnly -ErrorAction Stop
        $status = 'OK'
        # Multiple records can come back in a different order per response, so sort before comparing
        $answer = ($r.IPAddress | Sort-Object) -join ','
    } catch {
        # Negative responses (name does not exist), SERVFAIL, and timeouts land here. Keep the reason instead of discarding it
        $status = $_.Exception.Message
        $answer = ''
    }
    [pscustomobject]@{ Server = $server; Status = $status; Answer = $answer; Milliseconds = [int]$sw.ElapsedMilliseconds }
}

First, Line Up the Servers to Compare

The NRPT’s NameServers and DirectAccessDnsServers may not appear in the adapter’s DNS settings. If Step 3 asked the NRPT’s servers but Step 4 examines only the adapter’s servers, you end up comparing different paths.

The NRPT has rule types such as suffix, FQDN, prefix, and Any (.), and more specific rules take precedence.40 -Namespace only filters on the rule’s attribute; it does not match against the host name. That is why the code above expands the namespaces of the rules and matches them against the target name.23

On a split-DNS VPN, it is normal for the home-side resolver to return a negative response for an internal name while only the NRPT side returns a positive one. If you also compare servers outside the path, record them separately as a “control” and do not mix them into the judgment of zone mismatches. Timeouts against servers left on disconnected adapters are likewise separate from delays on the current resolution path.

Next, Read the Results Apart

Result What to investigate
Only a specific server times out Why that server is not responding
A negative response such as “the name does not exist” Distinguish it from a timeout, and check the name and the contents of the zone
The IP addresses in the responses differ Confirm the servers play the same role, and compare as record sets
Only the order of the records differs Possibly round robin. If the sorted sets are equal, do not call an order difference a zone mismatch

If they differ as sets as well, check the zone contents and serial numbers. Also, this is a measurement with the destination pinned by -Server. The delay caused by list position, “4 seconds until the fourth and later servers are reached” from Section 4.2, is checked in Step 3 or in its capture.

Resolve-DnsName -Name 'app01' -LlmnrOnly          # LLMNR only
Resolve-DnsName -Name 'app01' -LlmnrNetbiosOnly   # LLMNR or NetBIOS only (no DNS)
nbtstat -c                                        # NetBIOS name cache

This check targets single-label names. -NetbiosFallback falls back to NetBIOS only when DNS fails, so for a name that DNS can resolve it is not a NetBIOS check.8

Read the results as follows.

Result What it tells you / what it still does not
-LlmnrOnly succeeds It can be resolved through LLMNR. That does not mean, however, that this answer is what gets adopted in everyday use
-LlmnrOnly fails and -LlmnrNetbiosOnly succeeds You cannot conclude that NetBIOS answered. Because of dropped packets or the peer’s startup timing, LLMNR may have answered on a later attempt
Only this layer succeeds on the working PC, and it fails on the failing PC Suspect a dependency on the single-label-name path. The root fix is FQDNs and DNS registration

Which protocol answered is told apart in a capture by UDP 5355 (LLMNR) versus UDP 137 (NetBT). To confirm the everyday resolution path, also compare with the address returned by Resolve-DnsName without switches, and if they disagree, check the adopted response in the capture, because by default DNS is queried in parallel too.

Step 6: Diff the Settings Dumps

In an “only some PCs” investigation, run the same script on a working PC and a failing PC and compare.

# name-resolution-dump.ps1 -- run with administrator rights and compare the output files of the two machines side by side
$out = "$env:COMPUTERNAME-name-resolution.txt"
$sections = [ordered]@{
    'Get-DnsClientServerAddress' = { Get-DnsClientServerAddress | Format-Table -AutoSize | Out-String -Width 200 }
    'Get-DnsClientGlobalSetting' = { Get-DnsClientGlobalSetting | Format-List | Out-String }
    'Get-DnsClient'              = { Get-DnsClient | Format-Table InterfaceAlias, ConnectionSpecificSuffix, UseSuffixWhenRegistering -AutoSize | Out-String -Width 200 }
    'Get-DnsClientNrptPolicy'    = { Get-DnsClientNrptPolicy -Effective | Format-List | Out-String }
    'Get-DnsClientDohServerAddress' = { Get-DnsClientDohServerAddress | Format-Table -AutoSize | Out-String -Width 200 }
    'netsh dnsclient show state' = { netsh dnsclient show state 2>&1 | Out-String }
    'Get-NetIPInterface'         = { Get-NetIPInterface | Sort-Object AddressFamily, InterfaceMetric | Format-Table InterfaceAlias, AddressFamily, InterfaceMetric, ConnectionState, Dhcp -AutoSize | Out-String -Width 200 }
    'DNSClient policy registry'  = { Get-ItemProperty 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' -ErrorAction SilentlyContinue | Format-List | Out-String }
    'ipconfig /all'              = { ipconfig /all | Out-String }
}
$sections.GetEnumerator() | ForEach-Object {
    "===== $($_.Key) ====="
    try { & $_.Value } catch { "ERROR: $($_.Exception.Message)" }  # Leave missing items (such as DoH on Windows 10) recorded as errors
} | Set-Content -Path $out -Encoding UTF8
Write-Host "wrote $out"

What to compare are the order of DNS servers, the search list, connection-specific suffixes, the NRPT, DoH, interface metrics, and policy values.

HKLM\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient holds EnableMulticast for “Turn off multicast name resolution”, DisableSmartNameResolution for “Turn off smart multi-homed name resolution”, the search list, the primary suffix, and so on.4 Check the diff against the workings of each layer organized so far.

Step 7: Back It Up With a Packet Capture

Microsoft’s data collection procedure starts netsh trace start capture=yes on both the client and the server, discards the cache with ipconfig /flushdns, reproduces the problem, and stops with netsh trace stop.41

In Wireshark, filter with dns.qry.name == "app01.corp.example.com" or dns.qry.name contains "app01" to see which server was asked what, and what came back.

What the capture shows Where to look
No query goes out Besides the cache and hosts and other paths such as DoH, DoT, and link-local, check for UDP 53 being blocked by the sending side’s firewall
The query goes out but there is no response The route to the DNS server, firewalls, an unresponsive server
A negative response comes back The name queried and the records on the server side
A positive response comes back The connection side after name resolution. Check the address used and IPv6 as well

If the sending side’s firewall blocks UDP 53, Resolve-DnsName times out and no DNS query appears in the capture either. Isolate not only the case where name resolution succeeds and no traffic goes out, but also the case where it fails and no traffic goes out.3

Beyond DNS, check 5355 for LLMNR, UDP 5353 for mDNS, and UDP 137 for the NetBT name service. DoH is 443 and DoT is 853. How to capture and read captures is collected in the packet capture article.

9. Design on the Business App Side — Making It Robust Against Name Resolution

To make investigations lighter, it matters that the app side can record “which name, resolved to what, and where it failed”. Matching the app’s log against the settings dumps and captures that IT staff collect makes it easier to decide where in Chapter 8 to start.

Hold Destinations as FQDNs and Do Not Depend on hosts

Make the defaults in configuration files, shortcuts, and UNC paths FQDNs. This removes the dependency on suffix completion of single-label names and on LLMNR and NetBT. The cautions from Section 5.4, however, remain: mDNS alongside DNS for .local names, and the policy that appends suffixes to names without a trailing dot.

hosts is convenient for a temporary override during development, but it requires administrator rights and manual work. Distribution and change history are hard to manage, and some resolvers do not consult it at all (nslookup does not12). Switch destinations through configuration files.

Record the Result, Time, and Failure Reason of Name Resolution

At startup and similar points, record the IPv4 and IPv6 addresses and the elapsed time for the main destinations. Because Dns.GetHostAddresses returns the same result as getaddrinfo, you can trace “on which PC, since when, what it was resolved to”.11

// Record the name resolution results of the main destinations at startup (.NET 6 or later)
static async Task LogNameResolutionAsync(ILogger logger, string host)
{
    var sw = System.Diagnostics.Stopwatch.StartNew();
    try
    {
        var addresses = await System.Net.Dns.GetHostAddressesAsync(host);
        logger.LogInformation("Name resolution {Host} -> {Addresses} ({Elapsed} ms)",
            host, string.Join(",", addresses.Select(a => a.ToString())), sw.ElapsedMilliseconds);
    }
    catch (System.Net.Sockets.SocketException ex)
    {
        logger.LogError(ex, "Name resolution failed {Host} error {Code} ({Elapsed} ms)",
            host, ex.SocketErrorCode, sw.ElapsedMilliseconds);
        throw;
    }
}

Log failures and rethrow. Silently switching to a different name or a fixed IP makes the actual path unknowable during an investigation. With the error code and the elapsed time, IT staff can decide where in Steps 2 to 4 to begin.

Allow for Timeouts and IPv6 Answers

The DNS client spends up to 10 seconds per candidate queried against unresponsive servers.21 If suffix search produces several candidates, the total can exceed 10 seconds.

If the connection timeout is squeezed to 2 or 3 seconds, name resolution does not finish before the deadline in configurations such as one where the server that can answer is fourth or later. The second server, however, is queried after 1 second and the third after 2 seconds, so a single failed server does not necessarily mean failure. Design with the retransmission timing in Section 4.2 in mind.

Also, when an AAAA answer comes back and an IPv6 source address and route exist, Windows prefers IPv6 by default.38 Connection code that assumes IPv4 only may fail to connect even though name resolution succeeded. Separate the success of name resolution from the success of the connection, and handle both kinds of address.

10. Summary

The first things to separate in Windows name resolution are the shape of the name, the layer that returns the answer, and the path the app takes.

The cache and hosts answer first, and for single-label names DNS and LLMNR/NetBT run in parallel by default. For .local, mDNS joins in. Once resolution moves on to DNS, suffixes, retransmission timing, multiple NICs, and the NRPT change the result. DoH is a feature that switches that transport, and it is considered separately from the browser’s built-in resolver.

The investigation restricts the path in the order -CacheOnly, then -NoHostsFile -DnsOnly, then -Server, then -LlmnrOnly, and confirms with a settings diff and a capture. What matters is not to overlook the negative cache, the difference between no response and a negative response, and the client-side policies.

When “only this PC cannot connect”, first check these two things.

In what shape is the name being passed? On that PC, which path is answering?

With these two established, you can narrow down where to look.

KomuraSoft LLC handles root-cause investigations of name-resolution-related communication trouble such as “the business app cannot reach the internal server on only some PCs” and “it opens in the browser but the app fails at name resolution”, design reviews of whether a business app can withstand environment changes such as disabling LLMNR, DoH, and VPN, and implementation of a communication layer that records name resolution results and timeouts. If you attach settings dumps from a working PC and a failing PC when you contact us, the starting point of the investigation is settled quickly.

References

  1. Microsoft Learn, Secure DNS Client over HTTPS (DoH). On DoH being configurable only when the preferred/alternate DNS server is in the list of known DoH servers; the three encryption options in the Settings app and “Encrypted preferred” falling back to plaintext without notification; the Allow/Prohibit/Require values of the Group Policy setting “Configure DNS over HTTPS (DoH) name resolution”; why Require must not be enabled on domain-joined PCs; the known server list (Cloudflare, Google, Quad9) and Get-DnsClientDohServerAddress; adding servers with Add-DnsClientDohServerAddress; and use together with the NRPT.  2 3 4 5

  2. Microsoft Learn, MSFT_DNSClientGlobalSetting class. On the minimum supported OS for the WMI class underlying the DnsClient cmdlets being Windows 8 / Windows Server 2012. 

  3. Microsoft Learn, Troubleshoot DNS client name resolution issues. On the DNS client resolving in the order cache, hosts file, DNS server; no DNS traffic flowing when hosts has a matching entry; Resolve-DnsName timing out when UDP 53 is blocked; resolution taking about 4 seconds when few of several servers are reachable; nslookup querying only the first DNS server; the delay caused by a long suffix search list; specific queries using a trailing dot; and measuring elapsed time with Measure-Command.  2 3 4 5 6 7 8 9

  4. Microsoft Learn, Policy CSP - ADMX_DnsClient. On “Turn off smart multi-homed name resolution” (by default DNS, LLMNR, and NetBT are queried across all networks in parallel and multiple positive responses are adopted by binding order; when enabled, DNS, then LLMNR, then NetBT in sequence); “Turn off smart protocol reordering” (by default, link-local responses take priority for single-label names on non-domain networks); “Turn off multicast name resolution” (LLMNR being a secondary protocol and being disabled on all adapters; the registry value EnableMulticast); the DNS suffix search list and devolution; “Allow DNS suffix appending to unqualified multi-label name queries” (the policy that queries names containing a dot but without a trailing dot with suffixes appended as well); the primary DNS suffix; connection-specific suffixes; and the registry key Software\Policies\Microsoft\Windows NT\DNSClient.  2 3 4 5 6 7 8 9

  5. Microsoft Learn, DNS queries and lookups. On the contents of hosts being loaded into the cache when the DNS Client service starts and DNS responses also being held in the cache for their TTL; the query being built differently for FQDNs, multi-label names, and single-label names, with the suffix search list, primary suffix, devolution, and connection-specific suffixes used in turn; responses being cached whether positive or negative; the query order across multiple adapters and the exclusion of an adapter after a negative response; and adaptive timeouts and the caching of unresponsive servers.  2 3 4 5 6 7 8 9 10

  6. Microsoft Learn, VPNv2 CSP. On the DomainNameInformationList of a VPN profile being NRPT rules; only apps that use the Windows DNS API being able to use the NRPT while apps with their own DNS implementation bypass it; nslookup being the example; and Resolve-DnsName always being required for checking the NRPT.  2 3 4

  7. Microsoft Learn, Microsoft Edge policy: BuiltInDnsClientEnabled. On Edge using its built-in DNS client by default; this policy not affecting which DNS server is used; and DoH queries always being made by the built-in resolver.  2 3 4

  8. Microsoft Learn, Resolve-DnsName. On the parameters -CacheOnly (local cache only), -DnsOnly (DNS protocol only, without sending LLMNR or NetBIOS), -NoHostsFile (skip hosts), -LlmnrOnly, -LlmnrNetbiosOnly, -LlmnrFallback, -NetbiosFallback, -Server, -Type (default A_AAAA), -QuickTimeout, and -TcpOnly.  2 3 4 5 6

  9. Microsoft Learn, Windows security book: Network security. On the Windows 11 DNS client supporting DoH and DoT; DoH being configurable through Group Policy and programmatically; and encrypted DNS support being integrated with existing DNS configuration such as the NRPT, the system hosts file, and per-adapter and per-profile resolver settings.  2 3

  10. Microsoft Learn, getaddrinfo function (ws2tcpip.h). On converting a name to an address for the NS_DNS namespace through DNS, the local hosts file, and other mechanisms, aggregating the responses of multiple namespace providers, and the Unicode version being GetAddrInfoW.  2

  11. Microsoft Learn, Dns.GetHostAddresses Method. On being implemented with the underlying OS name resolution API (getaddrinfo on Windows), and on a host listed in the hosts file having its address returned without querying a DNS server.  2 3

  12. Microsoft Learn, Troubleshoot Azure DNS. On nslookup not using the OS’s local DNS resolver library and bypassing the local DNS cache, the hosts file, and the NRPT, and on Resolve-DnsName being the tool to use when those layers are involved.  2 3

  13. Microsoft Learn, ipconfig. On /displaydns showing the DNS client resolver cache, which includes both the entries loaded from hosts and recently resolved records; /flushdns discarding the cache including negative cache entries; and dynamic registration with /registerdns.  2

  14. Microsoft Learn, Troubleshooting DNS clients. On “Name does not exist” in ipconfig /displaydns for a failing name meaning that a negative response from the DNS server is cached on the client; resolving it with ipconfig /flushdns; and nslookup not using the client’s DNS cache. 

  15. Microsoft Learn, Windows Firewall profile doesn’t always switch to Domain when you use a third-party VPN client. On the default value of MaxNegativeCacheTtl under Dnscache\Parameters being 5 seconds, and 0 disabling the negative cache. 

  16. Microsoft Learn, Clear-DnsClientCache. On deleting the entire contents of the DNS client cache, equivalent to ipconfig /flushdns. 

  17. Microsoft Learn, Get-DnsClientCache. On retrieving the contents of the local DNS client cache and filtering by Name, Type, TimeToLive, Section, and so on. 

  18. Microsoft Learn, How to configure a domain suffix search list on the Domain Name System clients. On only the configured domain suffix search list being used once it is configured, with neither the primary DNS suffix, connection-specific suffixes, nor devolution used. 

  19. Microsoft Learn, Get-DnsClientGlobalSetting. On retrieving the DNS client’s global settings that are not tied to an interface (UseSuffixSearchList, SuffixSearchList, UseDevolution, DevolutionLevel). 

  20. Microsoft Learn, Get-DnsClient. On retrieving the per-interface ConnectionSpecificSuffix, RegisterThisConnectionsAddress, and UseSuffixWhenRegistering. 

  21. Microsoft Learn, DNS client resolution timeouts. On the retransmission timing with one, two, or three or more DNS servers (retransmit at 1, 2, 4, and 8 seconds from the start, give up at 10 seconds); processing stopping on a negative response and the next server being tried only when there is no response; and the fourth and later servers being reached no sooner than 4 seconds in.  2 3 4

  22. Microsoft Learn, Automatic interface metric. On interface priority on current Windows being determined by the interface metric, and on checking and changing the metric with Get-NetIPInterface. 

  23. Microsoft Learn, Get-DnsClientNrptPolicy. On retrieving the per-namespace settings configured in the NRPT (DNS client name servers, DirectAccess, DNSSEC, and so on), showing the effective policy with -Effective, and showing a specific namespace with -Namespace.  2

  24. IETF, RFC 6762: Multicast DNS. On mDNS being a protocol that resolves .local names within the same link by multicast on UDP port 5353.  2 3

  25. Microsoft Learn, Microsoft Security Bulletin MS11-030. On LLMNR using TCP/UDP 5355; the workarounds of blocking 5355 at the firewall and the Group Policy setting “Turn off multicast name resolution”; and the consequence that the computer may become invisible to other computers.  2

  26. IETF, RFC 4795: Link-Local Multicast Name Resolution (LLMNR). On LLMNR queries being sent by UDP multicast (port 5355) and TCP being used for unicast exchanges such as truncated responses. 

  27. Microsoft Tech Community, Networking Blog, Aligning on mDNS: ramping down NetBIOS name resolution and LLMNR. On the direction Microsoft announced in April 2022 of aligning on mDNS and gradually ramping down NetBIOS name resolution and LLMNR.  2

  28. Microsoft Learn, How to configure TCP/IP networking while NetBIOS is turned off. On the NetBIOS name service using UDP 137, the datagram service UDP 138, and the session service TCP 139, and on those ports no longer being listened on when NetBT is disabled. 

  29. Microsoft Learn, Windows security baseline (Azure Policy guest configuration). On the NetBT node types (B-node broadcast only, P-node WINS only, M-node broadcast then WINS, H-node WINS then broadcast); the default being B-node with WINS unconfigured and H-node with WINS configured; and P-node being the recommendation.  2 3

  30. Microsoft Learn, Windows Internet Name Service (WINS). On WINS being a legacy service that maps NetBIOS names to IP addresses, and on the recommendation not to deploy it anew but to use DNS, and to migrate to DNS and decommission it where it is already deployed.  2

  31. Microsoft Learn, nbtstat. On /c showing the NetBIOS name cache, /R purging the cache and reloading the pre-tagged entries from Lmhosts, and /RR releasing and re-registering with WINS. 

  32. Microsoft Learn, Features removed or no longer developed in Windows Server. On the Computer Browser service being deprecated as an outdated and insecure device discovery protocol, and on the treatment of legacy name-resolution-related features such as WINS. 

  33. Microsoft Learn, Direct host SMB over TCP/IP. On SMB 2.0.2 in Windows Vista / Windows Server 2008 and later requiring TCP 445 and not using the NetBIOS session transport. The document cites as a benefit that name resolution can be standardized on DNS, but that is a matter of the SMB transport and does not stop the client’s DNS client from resolving single-label names through LLMNR or NetBT (Section 5.4 of this article). 

  34. Microsoft Learn, Add-DnsClientDohServerAddress. On adding a DoH server configuration to the list of known servers, and on specifying the fallback on encryption failure and auto-upgrade with -DohTemplate, -AllowFallbackToUdp, and -AutoUpgrade. 

  35. Microsoft Learn, netsh dnsclient. On registering DoH and DoT servers with add/set encryption (dohtemplate, dothost, autoupgrade, udpfallback), the global doh/dot/ddr settings with set global, and show encryption, show global, and show state.  2 3 4 5

  36. Microsoft Learn, User data and privacy in Microsoft Edge: Secure DNS. On Secure DNS using the current provider by default and retrying in plaintext when the encrypted connection fails; not falling back to plaintext when a specific provider is chosen; and being disabled by default on organization-managed PCs. 

  37. Microsoft Learn, Microsoft Edge policy: DnsOverHttpsMode. On the three modes off, automatic, and secure, and on no DoH queries being sent on managed devices when the policy is not configured. 

  38. Microsoft Learn, Guidance for configuring IPv6 in Windows for advanced users. On Windows Vista and later choosing the address to use with the RFC 3484 prefix table and preferring IPv6 global unicast over IPv4 by default, and on not recommending disabling IPv6 but using “Prefer IPv4” with 0x20 in DisabledComponents.  2 3

  39. IETF, RFC 3484: Default Address Selection for Internet Protocol version 6 (IPv6). On the first rule of destination address selection being “avoid unusable destinations”, with destinations that have no source address or route excluded first and the candidates then ordered by prefix policy precedence. 

  40. Microsoft Learn, Configure DNSSEC rules using the Name Resolution Policy Table. On the NRPT namespace types (suffix, prefix, FQDN, subnet, Any); a suffix being a trailing match that includes child domains; and more specific rules taking precedence over more general ones. 

  41. Microsoft Learn, Troubleshooting Domain Name System (DNS) issues: Data collection. On the data collection procedure of starting netsh trace start capture=yes on the client and the server, discarding the cache with ipconfig /flushdns, reproducing the problem, and stopping with netsh trace stop. 

Recent articles sharing the same tags. Deepen your understanding with closely related topics.

These topic pages place the article in a broader service and decision context.

This article connects naturally to the following service pages.

Windows App Development

Implementing a business app that stands up to name resolution trouble, with a deliberate way of specifying destinations, timeouts, and logging of name resolution results, is Windows application development.

Frequently Asked Questions

Common questions about the topic of this article.

I edited the hosts file but the change does not take effect. Why?
On Windows, the contents of the hosts file are loaded into the cache when the DNS Client service starts, and name resolution proceeds in the order cache, hosts, DNS server. When a change does not take effect, first check the entry for that name with ipconfig /displaydns, and if an old answer is still there, discard it with ipconfig /flushdns. Next, question whether the tool you are testing with goes through the Windows resolver at all. nslookup does not use the OS resolver; it bypasses the cache, hosts, and the NRPT and queries the DNS server directly, so nothing in hosts is reflected in its output. To see the actual resolution result including hosts, use Resolve-DnsName or ping. If it still does not take effect, check whether the app, like a browser, has its own resolver or DoH.
The site opens in the browser, but only the business app fails at name resolution.
Most likely the browser and the app resolve the name over different paths. By default Microsoft Edge talks to the DNS server with its built-in DNS client rather than the OS DNS client, and if a different provider is chosen under Secure DNS (DoH), it queries an external resolver. On the other hand, .NET's Dns.GetHostAddresses, and an HttpClient that connects directly to the destination, go through the OS getaddrinfo, so they are subject to hosts, the DNS cache, the NRPT, and the DNS suffix search list (for requests that go through an HTTP proxy, the destination name is resolved on the proxy side). When the two return different answers, the fastest route is to match up which path asked which DNS server what, using Resolve-DnsName and a packet capture.
The settings should be identical, yet only some PCs cannot reach the internal server. What should I compare?
Compare the shape of the name and the layer at which each PC gets its answer. A single-label name (a name without a dot, such as server01) is completed with the PC's DNS suffix search list or the connection-specific suffix and sent to DNS, and by default it is also sent, in parallel, to same-subnet-only mechanisms such as LLMNR and NetBIOS broadcast (they are tried in sequence after DNS fails only when the optimization has been disabled; if WINS is configured, NetBIOS uses unicast and can cross subnets). A domain-joined PC may resolve the name because the suffix completes it to an FQDN, while a PC on VPN or on another subnet, or a PC with LLMNR and NetBIOS disabled, cannot resolve the same name. The reliable method is to collect the output of Get-DnsClientServerAddress, Get-DnsClientGlobalSetting, Get-DnsClient, and Get-DnsClientNrptPolicy -Effective on both a working PC and a failing PC and diff them. The root fix is to make the destinations in configuration files and shortcuts FQDNs.
Name resolution does not fail; it just takes several seconds before the connection finally goes through. What causes this?
This is the DNS client's timeout and retry mechanism showing through. Against a DNS server that does not respond, Windows retransmits at 1, 2, 4, and 8 seconds from the start and gives up at 10 seconds. Even with several DNS servers configured, if the one that responds is fourth or later in the list, Windows waits at least 4 seconds before it queries that server. A long DNS suffix search list also stacks up delay, because a single-label name is tried with each suffix in turn. Measure how long Resolve-DnsName takes with Measure-Command, and apply a dns.qry.name filter in Wireshark to see which server's queries go unanswered.
We disabled LLMNR and NetBIOS as a security measure, and now some devices can no longer be reached by name.
That is an expected side effect. LLMNR and NetBIOS over TCP/IP are secondary means of resolving the single-label names of devices that are not registered in DNS within the same subnet, and disabling them removes that path. Microsoft itself announced in 2022 a direction of aligning on mDNS and gradually ramping down NetBIOS name resolution and LLMNR, so the decision to disable them is itself the right one. The remedy is to consolidate name resolution on DNS: register the devices' A records in the internal DNS, or enable dynamic registration through DHCP, and rewrite the destinations of apps and shares to FQDNs. Devices that support mDNS can be resolved by their .local names, but that path, too, is limited to the range that multicast reaches.
What happens to internal name resolution when I enable DoH (DNS over HTTPS) on Windows 11?
DoH is a feature that switches the transport to HTTPS when the DNS client queries the configured DNS servers; the existing order of hosts, cache, and NRPT stays as it is. Unless DDR (Discovery of Designated Resolvers) is enabled, DoH can be used only when the server is in the list of known DoH servers, so if you want to use an internal DNS server, an administrator must register it with Add-DnsClientDohServerAddress. If the Group Policy setting "Configure DNS over HTTPS (DoH) name resolution" is set to "Require DoH", name resolution itself fails against servers that do not support DoH. Microsoft explicitly says not to enable this setting on domain-joined PCs, because the DNS Server service that ships with Windows Server, on which Active Directory depends, does not support DoH queries.

Author Profile

Profile page for the article author.

Go Komura

Representative of KomuraSoft LLC

Focused on Windows software development, technical consulting, and investigations into failures that are difficult to reproduce.

Back to the Blog