Follow this blog:
RSS
Email Alert

TR Dojo

Flush the ARP cache in Windows from the command line

Takeaway: Bill Detwiler shows you how to clear a specific entry from the ARP cache using the arp command and flush the whole thing with the netsh command.

The Address Resolution Protocol (or ARP) is a crucial component of IP networking on any operating system. The ARP Cache is a collection of ARP entries (mostly dynamic) that are created when a hostname is resolved to an IP address and then an IP address is resolved to a MAC address. The PC stores the mapped address in the ARP cache, and they stay there until the ARP cache entry timeout expires.

Although it doesn’t happen very often, a bad ARP entry can cause connection issues. When this occurs, deleting the problem entry can fix the problem. And if it doesn’t, you can flush the whole thing and let Windows rebuild the cache.

During this week’s TR Dojo episode, I show you how to view the ARP cahce and delete individual entries from it using the arp command and how to flush it with the netsh command.

June 8, 2011, 8:17 AM PDT | Length:00:05:04

View Transcript

How often do you use the netsh command?

Check out the following TechRepublic articles for more arp and netsh command tips:

For those who prefer text to video, click the View Transcript link below the video player windows or check out Jack Wallen’s article, “Quick Tips: Flush the ARP cache in Windows 7,” on which this video is based.

You can also sign up to receive the latest TR Dojo lessons through one or more of the following methods:

Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters.

Bill Detwiler

About Bill Detwiler

Bill Detwiler is Head Technology Editor of TechRepublic. Previously, he worked as a Support Tech and IT Manager in the social research and energy industries.

Bill Detwiler

Bill Detwiler
Bill Detwiler is Head Technology Editor for TechRepublic. Previously he worked as a Technical Support Associate and Information Technology Manager in the social research and energy industries. Bill is a Microsoft Certified Professional with experience in Windows administration, data management, desktop support, and system security.

Bill Detwiler

Bill Detwiler
Bill Detwiler has nothing to disclose. He doesn't hold investments in the technology companies he covers.

Transcript

Bill Detwiler: If a bad ARP cache entry is causing networkconnectivity problems on your Windows machine, then flushing the cache couldfix the problem.

I'm Bill Detwiler, and during this episode of TR Dojo, I'llshow you how to clear a specific entry from the ARP cache and how to flush thewhole thing.

The Address Resolution Protocol (or ARP) is a crucialcomponent of IP networking on any operating system - not just Windows.

Basically, it links Ethernet (or IP) addressing to hardware(or MAC) addressing.

The ARP Cache is a collection of ARP entries (mostlydynamic) that are created when a hostname is resolved to an IP address and thenan IP address is resolved to a MAC address (so the computer can effectivelycommunicate with the IP address). The PC stores the mapped address in the ARPcache, and they stay there until the ARP cache entry timeout expires.

This isn’t usually a problem, but sometimes a bad ARP entrycan cause issues with Internet connections and Web page loading. When thisoccurs, deleting the problem entry can fix the problem. And if it doesn’t, youcan flush the whole thing and let Windows rebuild the cache.

You can manage and clear entries from the ARP cache usingthe ARP command from a command prompt that’s running with elevated privileges.

So, click Start and then type cmd in the search dialog box,right-click the cmd.exe icon, select Run as Administrator, and respond to theUAC prompt.

The ARP command has several switches, but for the purpose ofthis exercise, we’re only concerned with two of them.

The -a switch displays all the ARP entries for allinterfaces

And, the -d switch deletes a specific entry from the ARPcache.

So if we’re trying to troubleshoot a connection problem thatwe suspect is cause an invalid ARP entry, we would run arp with the -a switchand look through the output.

If you find an entry with MAC address of all zeros, likethis one, we can use the -d switch to delete it from the cache. 

If removing a single entry doesn’t work, flushing the entirecache is your next step.

So, from the same prompt, enter the command:

netsh interface ip delete arpcache

Now, if you’re wondering why I didn’t use a command like

arp -d -a

or

arp -d *

Well, sometimes these commands work and sometimes theydon’t. So it’s best to stick with the netsh or network shell command, whichMicrosoft actually recommends.

Regardless of the method you use to flush the cache, you canuse the arp -a command to verify that it has indeed been cleared.

If the cache wasn’t cleared, you may need to disable Routingand Remote Services and then reissue the flush command.

To disable Routing and Remote Services:

Click Start | Control Panel, select Administrative Tools,and click Computer Management. Now double-click Services and Applications andthen double-click Services. Scroll down to Routing and Remote Services anddouble click it. Set the Startup Type to Disable and then make sure the serviceis actually stopped.

You should now be able to flush the arp cache with the netshcommand I showed you earlier.

In all honesty, invalid ARP entries aren't an extremely commonproblem and flushing a machine’s ARP cache is one of your last resorts whentroubleshooting a network connectivity issue. But when you’ve tried everythingelse, it can’t hurt.

So, thanks to TechRepublic blogger Jack Wallen for puttingthis tip together. I’ll link to his original blog post in the TR Dojo blog.

And as always, for more teachings on YOUR path to becomingan IT Ninja, visit trdojo.techrepublic.com, sign-up for our newsletter, orfollow me on Twitter.

Thanks for visiting the TR Dojo.

12
Comments

Join the conversation!

Follow via:
RSS
Email Alert