yes, yes, yes! 
FYI: the host file is a manual alternative to a DNS lookup which converts a name
like www.google.com into its proper ip address (74.125.19.147) so a connection can be made.
You can actually put this line (but don't!) in the host file and avoid the DNS lookup: eg
If you examine the host file, you'll see almost all lines are like
127.0.0.1 $some-domain-name
this forces any request for $some-domain-name to your local loopback address
which will ALWAYS fail (by design) and therefore you are protected from that site!
WHAT DOESN"T WORK?
Let's say that $some-domain-name has a real ip address of 123.456.654.321.
The bad guys don't always use their domain names! Instead, they access
their servers using the ip address! If there's a request for a site using an
ip address, then there's no need for a DNS lookup nor to access the host file
and you get caught!
SO, the host file will shield you from known, undesireable domain-name, but not access via ip-addresses!
Enter the need for the firewall, backlists, popup blockers and email scanners.