Ping IP returned "destination net unreachable", even with different network

Solution 1:

What your commands show is the following:

  1. Your computer has resolved www.facebook.com address to be 69.171.228.14
  2. It is trying to send ping packets to it
  3. On the packet's way a router (possibly your's, at address 204.15.23.57) cannot find route to 69.171.228.14
  4. So that you know about this the router 204.15.23.57 is informing you about this with the ICMP reply message Destination net unreachable.

In your second command you are pinging the router who gave you net unreachable reply, not facebook host, therefore unsurprisingly you get a reply from it.

As you have helpfully pointed out - this was result from a messed-up hosts file. You also could have seen the problem if you had used nslookup to query a DNS server directly:

nslookup
server 8.8.4.4
www.facebook.com

This would have shown you the actual address of the facebook host and you would have noticed that it is different from the one given to you (69.171.228.14 ), so you would have known to look in the hosts file as a computer resolves IP addresses through hosts file or DNS queries.

Having said that it is not good that a virus has been able to update the hosts file, since that should only be writable by a superuser/system (Administrator, SYSTEM or root on Linux). Therefore the implication is that the virus/trojan had high level access to the system.

Solution 2:

Destination Net Unreachable is a common ICMP error code displayed on the command prompt when the ping packets from your device fail to find a route to the network address of the IP address/domain name.

I have read your comment about you resolved this issue by clearing the Hosts file on your computer. Yes, wrong entries on a Windows Hosts file can be one of the many reasons for this issue.

Your computer might be compromised, and some malicious programs gained control enough to write host file entries. It is important to keep an AntiVirus on your computer to prevent it.

The most common reason to get a destination net unreachable error is a faulty routing table either on your computer or on the router itself. If it is a home network, the best solution is to power off the router, modem, hub, and PC on your network and restarts them after 2 minutes. It is called a Power cycle and it works most times.

Source: https://www.corenetworkz.com/2009/05/destination-net-unreachable-icmp-error.html

Solution 3:

Go to C:\Windows\System32\drivers\etc\ and open hosts in Notepad.

Delete all entries like this:

173.252.110.27 facebook.com
173.252.112.23 www.facebook.com
173.252.112.23 login.facebook.com
69.171.242.27 upload.facebook.com
66.220.152.19 graph.facebook.com
173.252.101.48 pixel.facebook.com
173.252.100.27 apps.facebook.com

Save the file.