Skip to contentGo to the directory tree
FileRisk: Caution
  • Windows Server

cache.dns C:\Windows\System32\dns\cache.dns

cache.dns: the DNS server's root hints, the list of root servers queried when no forwarder answers.

Updated on By AltF4 Formation

What it’s for

cache.dns stores the root hints, the names and addresses of the DNS root servers (A.ROOT-SERVERS.NET. and the others). The server uses them to start an iterative resolution from the root. With forwarders configured, it queries those first, then falls back on the root hints if the option “Use root hints if no forwarders are available” is checked, which is the default.

Despite its name, this is not the resolver cache: that one lives in memory, and is cleared with Clear-DnsServerCache.

What it contains

For each root server, an NS record for the “.” zone and an A (or AAAA) record:

. NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. A 198.41.0.4

Risks and best practices

  • An outdated or emptied list cuts Internet name resolution on a server without forwarders. Manage it through the console (Root Hints tab) or Add-DnsServerRootHint, not by editing the file.
  • On an internal server, prefer forwarders to your own resolvers. Root hints remain the fallback.
  • The service rewrites the file each time the hints change.

Useful commands

Fenêtre de terminal
# Configured root hints
Get-DnsServerRootHint
# Forwarders and root hint usage
Get-DnsServerForwarder
# Resolution test from the root
Resolve-DnsName www.microsoft.com -Server 127.0.0.1
# Clear the in-memory resolver cache (as administrator)
Clear-DnsServerCache

Report a mistake