Originally posted here by Guus
Your hosts-file is used by the TCP/IP protocol
To clarify, it's used by IP to resolve the names into IP addresses.