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

Gamer9430

macrumors 68020
Original poster
Apr 22, 2014
2,248
1,405
USA
On all of my Windows computers, I use an actively updated Hosts file from http://winhelp2002.mvps.org/hosts.htm to do system-wide ad blocking. I'm curious as to it being possible to do the same thing on macs. This would especially help on PPCs since you wouldn't need to slow down your browsing experience by using an adblocker since the hosts file prevents even connecting to ad servers. The website I like has instructions for Mac installation, but it doesn't seem to work on the few macs I tried on (both PPC and Intel).

SOLUTION: I actually just got it working by following the directions here: http://www.makeuseof.com/tag/how-to-edit-the-mac-os-x-hosts-file-and-why-you-might-want-to/

I only went to /private/etc/ then replaced the file directly, then flushed the DNS and now it works perfectly.
 
Last edited:
The directions on this page (http://pointhope.de/tips&tricks/no_place_like_localhost.html) should work. Have you viewed the new hosts file to verify its correct? You say "it doesn't seem to work", can you explain how your testing?

I did exactly as directed (except that some of the commands were out of date on Leopard/Tiger). I used the same file in Windows and that worked fine.

SOLUTION: I actually just got it working by following the directions here: http://www.makeuseof.com/tag/how-to-edit-the-mac-os-x-hosts-file-and-why-you-might-want-to/

I only went to /private/etc/ then replaced the file directly, then flushed the DNS and now it works perfectly.
 
If you have multiple servers, you might look at running your own DNS server and set up the entries there.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.