This page contains information and commands about viewing and clearing the DNS and ARP caches on Windows computers, as well as the hosts file.
- Hosts File
- DNS Cache (CMD)
- DNS Cache (PowerShell)
- ARP Table
Hosts File
When performing a DNS query to lookup the IP for a hostname, the hosts file is first checked to see if an entry exists. If it does, the IP in the host file is used. If not, a query is sent to the configured DNS server.
The hosts file on Windows should be located here:
C:\Windows\System32\drivers\etc\hosts
DNS Cache (CMD)
View DNS Cache (CMD)
Clear DNS Cache (CMD)
DNS Cache (PowerShell)
View DNS Cache (PowerShell)
Clear DNS Cache (PowerShell)
ARP Table
The below can be used in either CMD or PowerShell
View ARP Cache
Clear ARP Cache
For a specific IP:
Clear all ARP entries: