How to Clear the ARP Cache in Linux Terminal

Just like your web browser caches images to load websites faster, your Linux operating system caches MAC addresses to speed up network communication. This is known as the ARP (Address Resolution Protocol) cache. It maps IP addresses to the physical MAC addresses of devices on your local network.

Usually, this cache is managed automatically. However, if a device on your network recently changed its IP address (for example, a printer or a router), your Linux machine might still be trying to send data to the old, cached MAC address, resulting in connectivity errors. Flushing the ARP cache forces your computer to re-discover the correct network pathways.

How to View the Current ARP Cache

Before deleting anything, you might want to view the current contents of the cache.

  1. Open your terminal.
  2. Type the following command and press Enter:
    arp -a

This will output a table showing IP addresses and their corresponding MAC (Hardware) addresses.

How to Flush the ARP Cache

To clear the entire cache across all network interfaces, the easiest method is to use the ip command, which has largely replaced the older arp utilities in modern Linux distributions.

  1. Open your terminal.
  2. You will need root privileges. Run the following command:
    sudo ip -s -s neigh flush all
  3. Enter your password when prompted.

The command will output a brief summary indicating how many entries were flushed. Your Linux machine will now rebuild the ARP cache from scratch the next time it communicates over the local network, cleanly resolving any IP conflict issues.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.