Posted by: glasskeys | 06/03/2011

How to quickly enable “ad blocking” on Android CM7.

(To view a larger image with a more detailed description tap or click a thumbnail.)

To quickly enable “ad blocking” on Android CyanogenMod you can utilise an old Linux/*nix trick — addition of entries to the /etc/hosts file to resolve to (localhost) so that all ad serving network domains point to…nothing.

In proper English this means that any location that matches an “ad serving” web address instead points to the local machine, and therefore never get loaded.

To start using your own “ad blocker”, save this file on your Android CM7 tab. For purposes of this tutorial we will assume the location is in the /sdcard/download folder. Next open the Terminal Emulator and at the $ prompt type the following commands:
#cp /sdcard/download/hosts.txt /system/etc/hosts
(tap y key at the prompt)

(Use the tag cloud at right to view similar topics.)


  1. Says the file already exists. I’m looking around, but can’t find the command to overwrite.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: