Panther Tiger Leopard Snow Leopard Lion Mavericks Yosemite El Capitan Sierra

Mac OS X Lion and Mountain Lion /etc/hosts file to block sites

Post Reply
macosx / lion     Views: 2372Prev .. Next
Mac OS X Lion and Mountain Lion /etc/hosts file to block sitesPosted: Tuesday, September 3, 2013 [19:36:43] - 1
rootPosted by:rootMember Since:
June 16 2010
Posts: 195
Since upgrading to Mountain Lion my /etc/hosts file stopped blocking sites I do not want to track me.
In particular I do not like ads (Google Ads or any other ads), nor I like Google Analytics to see where I've been.
Adding the following lines to my /etc/hosts file did not help:
View Code127.0.0.1 googlesyndication.com www.googlesyndication.com pagead2.googlesyndication.com pagead.googlesyndication.com
::1 googlesyndication.com www.googlesyndication.com pagead2.googlesyndication.com pagead.googlesyndication.com
127.0.0.1 adwords.google.com adservices.google.com
::1 adwords.google.com adservices.google.com
127.0.0.1 imageads.googleadservices.com imageads1.googleadservices.com www.googleadservices.com
::1 imageads.googleadservices.com imageads1.googleadservices.com www.googleadservices.com
127.0.0.1 google-analytics.com www.google-analytics.com
::1 google-analytics.com www.google-analytics.com
127.0.0.1 apps5.oingo.com
::1 apps5.oingo.com

although it worked in Leopard just fine.

Searching the Internet did not bring anything and only recently I came across one blog that pointed-out that the following Terminal command actually does changes to the file making end of the lines a proper UNIX format:
View Codehexdump -C /etc/hosts

Do not forget to refresh your new settings by Terminal command:
View Codedscacheutil -flushcache

Finally, my /etc/hosts file filtering my traffic again!There's no place like ~
RE: Mac OS X Lion and Mountain Lion /etc/hosts file to block sitesPosted: Wednesday, September 4, 2013 [13:14:56] - 2
rootPosted by:rootMember Since:
June 16 2010
Posts: 195
Editing /etc/hosts file requires sudo privileges in Terminal as following:
View Codesudo pico /etc/hosts

or
View Codesudo pico /private/etc/hosts

essentially it's the same thing.
When finished editing enter:
View Codecontrol + x

and
View Codey and then hit Enter

it will save the file (actually overwrite it with new data).

Additionally you can include other advertisement networks in your /etc/hosts file to speed-up page loads while browsing the Internet.
Every banner load in a browser takes time. By not loading all those banners (redirecting them to your local host) your browser speed-up page load.

Here is some more advertisement networks to include in your /etc/hosts file:
View Code127.0.0.1 ad.yieldmanager.com
::1 ad.yieldmanager.com
127.0.0.1 ad.doubleclick.net pubads.g.doubleclick.net
::1 ad.doubleclick.net pubads.g.doubleclick.net

feel free to add more networks below.There's no place like ~
RE: Mac OS X Lion and Mountain Lion /etc/hosts file to block sitesPosted: Thursday, October 31, 2013 [06:52:02] - 3
rootPosted by:rootMember Since:
June 16 2010
Posts: 195
This will remove annoying double underlined text advertisement:
View Code127.0.0.1 images.intellitxt.com
::1 images.intellitxt.com

as well as all associated Ad Choices in the text etc.There's no place like ~
RE: Mac OS X Lion and Mountain Lion /etc/hosts file to block sitesPosted: Tuesday, December 24, 2013 [01:47:19] - 4
Posted by:GuestPosts: 1
Besides using hosts file some browser plug-ins could be used as well.
I am not affiliated in any way with below listed service and have never used them myself.
Although I did see some nice reviews of the following services:
- Disconnect - http://www.disconnect.me
- AdBlock Plus - http://adblockplus.org
- DoNotTrackMe - http://www.abine.com
RE: Mac OS X Lion and Mountain Lion /etc/hosts file to block sitesPosted: Monday, January 27, 2014 [22:02:10] - 5
rootPosted by:rootMember Since:
June 16 2010
Posts: 195
Interestingly enough, I have tried the disconnect.me and it's not blocking Adsense, double-click or any other Google related services.
Removed the plug-in after trying.
My guess would be, whoever pays disconnect.me - keeps their services working or, is it a small business on a side for Google?There's no place like ~
macosx / lionPrev .. Next
 
Post Reply
Home - Macosx: Panther Tiger Leopard Snow Leopard Lion Mavericks Yosemite El Capitan Sierra