Windows & LAN-related routing problems

Updated: October 11, 2024

Here's a sad little scenario for you. Imagine you have a local network set up, with multiple computers, including at least two Windows hosts. Let's say you want to copy files from one Windows host to another. Let's also assume you have properly configured sharing, and the other relevant machine is easily accessible through Windows Explorer, e.g.: via \\MACHINE. Now you copy a file, great. Three minutes later, you try to copy a second file. Windows Explorer throws a hissy, no can do. What now?

I've encountered this exact problem a few days ago. As is my nature, I always assume something is wrong with how I do things, how I set up my systems, etc. Check router, no problem. Try to access the target Windows host from a Linux machine, no problem. Network connectivity issues, nope. So what then? Let me show you what has happened, and if you ever hit the same snag, how to get around it, quickly.

Problem in more detail

The wise and experienced among you already know what the problem is. The problem is, ordinary people do not think in relevant "nerdy" terms to be able to articulate the system issue they're facing. In general, if you ever find yourself facing some sort of problem in a computer system, if the problem manifests through some visual interface, a GUI of some kind, you should try to replicate the scenario on the command line, because you will usually get way more information - and more accurate information.

Windows hosts can be accessed from the command-line, too. The easiest way to check connectivity among computers is through the ping command (using the ICMP protocol). While it does not guarantee everything is hunky-dory, if you do get a successfully reply from the other (target) host to your ping query from the source system, then most likely, there isn't a wider network-related issue (your own LAN, that is).

So I tried to ping the "ailing" machine, in order to figure out what's wrong. Open cmd.exe (Start > Command Prompt), and run the following line:

ping [ip address or hostname]

If you do not know the IP address of the affected system, then:

Open Windows Settings > Network & Internet > select the relevant network; it could be wired or Wireless network. Just click on the button that says Properties. This will open a new page, and at the bottom, there will be some network-related information, including the IP address. See below. Note, this is not indicative of any specific setup, just a set of steps that shows how to obtain the data:

Network properties

IP address

Look at the line that reads IPv4 address - you may also have an IPv6 address, but that's most likely not going to be a problem, and overall, 99% of all home LAN networks will have been configured using IPv4. Take note of the address (X.X.X.X). Copy that number over to the command prompt we opened earlier.

I did, and lo and behold, an issue!

Pinging 192.168.4.113 with 32 bytes of data:
Reply from 192.168.4.107: Destination host unreachable.
Reply from 192.168.4.107: Destination host unreachable.

I was trying to ping a host with an IP address that ends in 113, but I was received a reply from 107. The second address is the address of the source Windows machine, the one that was trying to reach the target host, so we could copy some files. For whatever reason, the source system had lost its bearings, and could not find the other one, even though everything had worked fine just moments earlier.

Technically speaking, I was having either an ARP or DNS problem on my Windows host. The finer detail of how the network stack works is truly beyond the scope of this article. After all, people reading this guide will want a quick solution, not a lecture on network protocols. Bottom line, my Windows system had gotten confused, and was seeing wrong information. We need to clear that information out, i.e., clear the caches.

There are two things you can do, first clear the ARP cache, then the DNS cache. Try one, if that fixes the problem, great, if not, try the second command. We need to launch Command Prompt as Administrator. Once you locate it in the Windows system menu, right-click > Run as Administrator.

CMD administrator

Then, type the following:

arp -d *

Then, optionally, if the first command does not resolve the issue, we need to clear the DNS cache:

ipconfig /flushdns

Try to access the target host now. You will most likely succeed, as there were no other issues previously, so you're obviously not facing a complex, environment-related problem. Remember, as I outlined in my scenario early on, it worked one minute, then it didn't the next.

If this does not help, you can reboot, but that's really not the best way about it.

Conclusion

And thus we bring this witchcraft tutorial to its close. I am never ever happy with weird, random, sporadic issues that defy logic and common sense. Especially when it comes to networking. But bugs can happen, and so you need to be prepared for how to handle and troubleshoot those. Always work methodically, try to use the command line, if you can, and figure out more details about the problem at hand.

In my case, a Windows machine had decided to suddenly exhibit caching problems with its network-related information, which is why a query from one host to another, a query that had worked perfectly only moments earlier, suddenly failed. A ping command revealed the source of the issue. Clearing the network caches resolved it. Well, if you hit a snag like this, try not to hurl expletives at the computer, like I did at first, just open the command line and do some furious typing. We're done. Take care, fellas.

Cheers.