Search Our Database
How to flush DNS cache on Windows (CMD & PowerShell)
Introduction
Domain Name System (DNS) caching is a process where Windows stores previously resolved domain names locally. This allows the system to load frequently visited websites faster without repeatedly querying DNS servers. While useful for performance, it can cause issues when DNS records change, such as after a website migration, DNS update, or propagation delay.
For example, if a domain is moved to a new hosting server but the Windows system is still caching the old IP address, the user may be unable to access the updated site. In such cases, clearing or “flushing” the DNS cache forces Windows to discard outdated records and fetch fresh ones directly from DNS servers.
This article provides detailed steps on flushing the DNS cache using both Command Prompt (CMD) and PowerShell, applicable to Windows 11, Windows 10, Windows 8, and earlier versions.
Prerequisites
- A Windows system (Windows 11, 10, 8, or 7).
- Administrator privileges (required to run the commands).
- Basic familiarity with opening Command Prompt or PowerShell.
Step-by-step Guide
Step 1: Open Command Prompt as Administrator
- Press Windows Key + S and type cmd.
- Right-click Command Prompt and select Run as administrator.
Step 2: Flush DNS Using Command Prompt
In the Command Prompt window, run the following command:
ipconfig /flushdns
Expected output:
Step 3: Flush DNS Using PowerShell (Alternative Method)
- Press Windows Key + S and type powershell.
- Right-click Windows PowerShell and select Run as administrator.
- Enter the following command:
Clear-DnsClientCache
This command runs silently without confirmation, but the cache is cleared immediately.
Step 4: Verify the DNS Flush
To confirm the DNS cache has been cleared, run the following command:
ipconfig /displaydns
If the cache is empty, no domain entries will be displayed. When you visit a website again, new DNS records will populate this list.
Conclusion
Flushing the DNS cache in Windows removes outdated or incorrect domain records, forcing the system to retrieve updated DNS information. This is particularly useful when troubleshooting website access problems, resolving DNS propagation delays, or fixing incorrect redirections.
Windows provides two easy methods to flush DNS — using Command Prompt with ipconfig /flushdns, or using PowerShell with Clear-DnsClientCache. Both achieve the same result and ensure that your system always resolves domain names using the most current DNS data.
Should you have any inquiries about the guidelines, please feel free to open a ticket through your portal account or contact us at support@ipserverone.com. We’ll be happy to assist you further.