What your commands show is the following:
- Your computer has resolved www.facebook.com address to be
- It is trying to send ping packets to it
- On the packet's way a router (possibly your's, at address 184.108.40.206) cannot find route to 220.127.116.11
- So that you know about this the router 18.104.22.168 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:
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 (22.214.171.124 ), 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.