Flush DNS Cache with PowerShell
Awhile ago I wrote a blog post called PowerShell Networking Cheat sheet, where I put together several networking commands which can be replaced by PowerShell. One of the latest once I saw and a couple of people requested is how you flush the DNS cache using PowerShell. This would allow you to replace ipconfig/ flushdns with PowerShell. Guess what, Microsoft as now a PowerShell cmdlet for that.
Clear and Flush DNS with PowerShell
You can use the following command to clear the DNS cache on a Windows system using PowerShell
1 | Clear-DnsClientCache |
Show DNS Cache with PowerShell
There is also a PowerShell command to show you the DNS cache:
1 | Get-DnsClientCache |
I hope this blog post and these commands are useful.