• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

DIY Uber Hosts File to block ads & trackers

I know some people use the AdFree app, but I find it's just as easy and less hastle to roll my own.

Using mathdotrandom: Block ads on PC & Android with an uber HOSTS file! as a guideline I downloaded the following hosts files:

The Uber hosts file from the above site (last updated 22 Dec 2010)
The mvps hosts file (last updated 18th Feb 2011)Blocking Unwanted Parasites with a Hosts File
The yoyo hosts file (last updated 31st Jan 2011)Ad server hostnames for blocking ads (format: hosts -- in hosts file format)

Then merged:

Code:
C:\Documents and Settings\Kris>java -cp "c:\temp\MergeHosts.jar" com.ri.hosts.MergeHosts "c:\temp\hosts"

MergeHosts - looking for "hosts.*" files in: C:\Temp\hosts

Found hosts files:
   hosts.mvps
   hosts.uber
   hosts.yoyo

Processing: hosts.mvps
   14795 domains successfully extracted, with 0 collisions

Processing: hosts.uber
   23151 domains successfully extracted, with 14535 collisions

Processing: hosts.yoyo
   2739 domains successfully extracted, with 2728 collisions

DONE!
Final hosts file: C:\Temp\hosts\hosts.final
Size: 675KB
14795+8616+11=23,422 ads & trackers blocked!

I then merged that with the hosts list from AdFree which added an extra 180. So the total is now 23,602 and the resulting file is 680KB in size.

If you wanted you can also merge extra lists from Fichier hosts - Acc
 

Attachments

  • hosts.zip
    137.7 KB · Views: 146

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones