Use this when a Windows machine resolves names wrongly or slowly, or when DNS registration of the machine fails.
DNS Client
The Windows DNS client resolves names using its cache, the hosts file, configured DNS servers and suffix search lists, and registers the computer's own records dynamically in DNS.
1. Resolve-DnsName <name> — answer?
2. Which server? Get-DnsClientServerAddress.
3. Query directly: Resolve-DnsName <name> -Server <dns>.
4. hosts file or cache override?
5. Suffixes for short names.
application → DNS Client service → cache/hosts → servers → answer
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
nslookupPrimary Commands
Configuration and operational commands for this Topic.
nslookupTroubleshootQuery DNS servers from Windows.
Windows / PowerShell · mixedResolve-DnsNameReferenceQuery DNS from PowerShell, with record type and server options.
Windows / Windows Server / PowerShell · mixedClear-DnsClientCacheReferenceClear the Windows DNS client cache.
Windows / Windows Server / PowerShell · mixedSubtopics
Go one level deeper into this subject.
The Windows DNS resolver looks up names by checking the hosts file and cache, then querying configured DNS servers in order, applying suffixes for short names, and falling back to LLMNR or NetBIOS if enabled.
Subtopic DNS Client CacheThe DNS client cache stores recent name lookups, including negative answers, for their TTL.
Subtopic DNS SuffixA DNS suffix is the domain part added to a computer's or interface's name, such as corp.local.
Subtopic DNS Search ListThe DNS search list (suffix search list) is the list of domains Windows appends to single-label names, such as turning fileserver into fileserver.corp.local.
Subtopic hosts FileThe hosts file (C:\Windows\System32\drivers\etc\hosts) maps names to IP addresses locally and is checked before DNS.
Subtopic DNS TroubleshootingTroubleshoot Windows DNS with Resolve-DnsName or nslookup against specific servers, ipconfig /all for configured servers and suffixes, ipconfig /flushdns, the hosts file and the DNS Client event log.
- The hosts file wins over DNS.
- Negative answers are cached too.
- Domain members must use internal DNS only.
Resolve-DnsName <name>— resolve via the Windows resolverGet-DnsClientServerAddress— DNS servers per interfaceGet-DnsClientCache— resolver cacheGet-DnsClientGlobalSetting— suffix search listClear-DnsClientCache— flush the cache
ReferenceWhy it matters1 section · depth on demand
Internals and state
Windows name resolution uses the caller and DNS Client service/cache, suffix/search policy, configured interface DNS servers and recursive/authoritative responses.
ReferenceHow it works1 section · depth on demand
State
Windows name resolution uses the caller and DNS Client service/cache, suffix/search policy, configured interface DNS servers and recursive/authoritative responses.
ReferenceImportant terms & boundaries3 sections · depth on demand
How it works
The DNS Client service (Dnscache) resolves names for applications: it checks the hosts file entries and its cache, then queries the configured DNS servers, appending suffixes for single-label names. It also caches answers (positive and negative) and registers the computer's A/AAAA records dynamically. Separate resolvers run first for some names: NRPT rules (DirectAccess/VPN), and LLMNR/mDNS for local names if DNS fails.
Platform, version and operating-envelope scope
Windows DNS Client and Windows Server DNS where applicable; NRPT, DoH and interface behavior vary by release/policy.
Commands
Resolve-DnsName www.example.com
Resolve-DnsName www.example.com -DnsOnly -Server 10.0.0.53
Get-DnsClientNrptPolicy
ipconfig /registerdns
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in DNS Client. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows-server/networking/dns/dns-client-settings · confidence 94%