Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

packt

macrumors newbie
Original poster
Oct 12, 2011
1
0
Does anyone know how to get the HOSTS file in "/etc" working with 10.7.2?

I use a list of domains in the HOSTS file to block adverts and it worked fine until I updated to 10.7.2 when it stopped recognising any of the domains.

I've tried replacing the file and editing it but my browser doesn't seem to block anything I put in there.
 

r0k

macrumors 68040
Mar 3, 2008
3,611
75
Detroit
I have some entries in my /etc/hosts file for servers and printers with static IPs and it still works fine in 10.7.2. I don't have that extremely long list of blocks all set to 127.0.0.1 that I've seen going around the 'net. I rely on adblock and flashblock in my browsers and they do well enough for me.

Darn. I just remembered. There is an etc/hosts but it seems to be ignored. I also have a /private/etc/hosts that just happens to have all my local server stuff too. I must have found and fixed it a long time ago and forgot its location. I doubt that doing anything to /etc/hosts will have any effect.

You need to edit /private/etc/hosts.
 
Last edited:

bluntmike

macrumors newbie
Oct 13, 2011
6
0
I had the same problem this morning after installing 10.7.2

I tried moving my hosts above the first ipv6 entry, also tried adding whitespace to the foot of the file. Moved all my custom hosts to the very top of the file, to just below the ipv4 localhost entry but still above the ipv6 entry and back to the bottom again. None of this worked.

I have now installed Macports and DNSMasq and am using 127.0.0.1 as my DNS server - DNSMasq looks at your hosts file so there's no need to create zonefiles if you go this method, it just seems to "re-link" the hosts file so it works as it is supposed to.

I followed the guide on this URL: http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/

The updates mentioned on that page didn't work for me - only the original solution of installing DNSMasq with Macports

PS: @r0k - editing /private/etc/hosts didnt work for me either.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.