CMD Command to Flush DNS Cache in Windows 10/11
The Windows operating system holds onto a cache of DNS data called DNS resolver cache, so it does not have to reach out to the DNS server for every single name resolution request.
One can check the current DNS cache using the following CMD command:
If you experience problems with name resolution on your Windows 10 PC, you can flush the DNS cache with the following command:
flushdns command removes locally cached copies of the DNS resolver and forces Windows to request a new record from the DNS server.
On a PowerShell prompt, you can display and flush DNS with
Clear-DnsClientCache commands, respectively.
Check the DNS client cache:
Flush the DNS client cache:
Get-DnsClientCache command is run in the following screenshot, and it shows the DNS cache on a Windows 10/11 computer.
Troubleshooting Name Resolution
A powerful tool for troubleshooting name resolution on Windows is
nslookup which allows us to perform manual DNS queries from the command prompt.
The following screenshot shows a simple example of the use of
The first two lines show the name and IP address of the DNS server that has responded. The answer section contains the actual response to the lookup, which is IPv4 and IPv6 addresses for the domain name.
Resolve-DnsName is the PowerShell equivalent to the
Resolve-DnsName command is run in the above screenshot. It shows the IPv4 (A record) and IPv6 (AAAA record) addresses of the domain name.