Flushing the local DNS cache clears incorrect or stale name-to-address results that can break browsing, remote access, and VPN connections after a DNS change. Clearing cached entries forces Windows to request fresh DNS data, which helps restore access and speeds up troubleshooting.
Windows performs hostname resolution through the DNS Client service, which keeps a shared resolver cache on the system. Most applications consult this cache first, and Windows only contacts upstream DNS servers when no valid cached record exists.
A cache flush does not change DNS server settings or override entries in the C:\Windows\System32\drivers\etc\hosts file. The flush command must run in an elevated Command Prompt, and some applications maintain their own internal caches and may require a restart before fresh lookups are used.
Related: How to change DNS servers in Windows
Related: How to add a static DNS entry in Windows
Steps to flush DNS cache in Windows:
- Open the Start menu.

- Search for Command Prompt.

- Select Run as administrator for Command Prompt.
Accept the User Account Control prompt to open an elevated console.
- Flush the DNS resolver cache from the elevated prompt.
C:\> ipconfig /flushdns Windows IP Configuration Successfully flushed the DNS Resolver Cache.
The Successfully flushed the DNS Resolver Cache. message confirms the cache was cleared.
- Confirm name resolution for the affected hostname.
C:\> nslookup files.example.net Server: 192.0.2.53 Address: 192.0.2.53 Non-authoritative answer: Name: files.example.net Address: 198.51.100.24
Replace files.example.net with the hostname that was failing.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
