Clearing ARP cache

first, lets explain a little bit about ARP.

1. ARP is the process of resolving a mac address from an IP address. It is broadcasted to every host on the local subnet. The very purpose of an ARP cache, is to store the IP to MAC combination in the case that you might be sending traffic to that same host (IP/Mac address). Having the ARP cache allows you to not have to send an APR broadcast to every node on your local subnet, because you already have it in the cache!

2. Clearing the APR cache will cause all request that were in the ARP cache to go through the APR process again (if the node tries to communicate with them).


In any case, how do you clear ARP and DNS cache in linux?

  1. To view the ARP cache:
    • Open a terminal prompt
    • Become root on your machine
    • Run command: arp -n
  2. Clear ARP cache and validate:
    • Run command: ip -s -s neigh flush all
    • Run command: arp -n
    • Compare the last command results to the first (should have less rows)

This process can also be done in MS Windows as well,


Use the NetShell (netsh) command to clear, delete or refresh the Address Resolution Protocol (ARP) cache by following the following steps.

  1. Click on Start button.
  2. Click on Run command and type Cmd into the Run text box, and then press Enter. For Windows Vista or later OS, type Cmd in Start Search, and then press Ctrl-Shift-Enter keyboard shortcut to force Administrator privileges. Enter Administrator user ID and password and allow any permission request when prompted.
  3. In the Command Prompt window, type the following command then press Enter.

netsh interface ip delete arpcache