Hosts file not being read/understood

carz

Registered
I have a bunch of entries in my hosts file for sites that I want to block. This was working fine as of recently and now the entries get completely ignored.

for example, this is my current host file:

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

127.0.0.1 google.com

I just want to do something as simple as blocking google. That code would make sense right? but it isnt!

Anyone have any idea why this is happening or what the solution is? Thanks in advance
 
What I would use (and do block sites) instead would be controlling your own DNS by using something like OpenDNS.com. By following the steps in their video tutorial you can block groups of sites or individual site as you please.
 
thats helpful, thank you.

but at the same time....it doesnt help resolve my issue of my hosts file not being properly read
 
the problem with the hosts file is that it doesn't support subdomains - everything has to be stated explicitly. Thus, there's a difference between
Code:
127.0.0.1 google.com
127.0.0.1 [url]www.google.com[/url]
So:
  • your hosts file is working perfectly
  • you don't have the proper understanding of how it works
  • if you want to use the hosts file to block everything google has you'll have to put each and every 2nd and 3rd level domain into the hosts file.
At present, the only real use for the hosts file is for the few entries that's standard - for everything else one is using other services. You can read about the history of the hosts file here: wikipedia

If you really want to block google.com comprehensively, you'll have to use other services:
  • outgoing firewall (eg Little Snitch)
  • local dns service (eg dnsmasq)
  • ad blocking programs / extensions (eg adblock+, GlimmerBlocker)
Several of these can work together, eg I've got dnsmasq, adblock+ and GlimmerBlocker all running on my computers.
 
Last edited:
Thanks for that bit of knowledge.

You may be right, I may not have a total understanding on how the hosts file work. However, the reason I believe there may be an issue is because of my Adobe products.

Originally I had the host files blocking the adobe paths to ignore the registration. It worked fine for about a year or so...never had an issue...now all of a sudden it failed. I also had a list of other sites that I wanted blocked that was working at one point....all of a sudden not work.
 
If you 'just' want to hinder some of your application from phoning home, you are way better off using Little Snitch instead of the un-reliable and hard-to-use hosts file.
 
Back
Top