Solid host files are an important part of a secure system. I'm looking for a piece of software that could automate the process:

The required software would ideally work in the following way:

  • Modify the host file, replacing it by a suitable host file which

    • blocks notable source of malware
    • blocks ads
  • Maintain this file up-to-date, without needing user intervention.

Some nice-to-have side requirements.

  • Free (as in FLOSS)
  • The less visible impact on the environment, the better.
  • Give the installer some control on what ads to block/not to block, allow whitelisting.


I'm interested in answers both for Android and desktop OSes (GNU/Linux and Windows), ideally a range of software by the same editor running on each and every platform as this would minimize the need to get accustomed to each piece of software.


Though I'm not aware of any generic solution working on all mentioned systems, there are several of them for Android. Google kicked most of them off the Playstore, but most of them can still be found on F-Droid, where they can be downloaded via browser directly from the website, or using their own Android app (similar to the Google Play Store app).

AdAway allows to automatically update the hosts file on Android (click image for larger variant)

The most famous solution here probably is AdAway, which maintains the hosts file as described by your question. The app takes care for updating it with changes. Alternatively, you can do so manually by downloading the file and replace the one your system uses – which makes it a possible solution for all the systems mentioned. A list of sources can be found on the AdAway Wiki, and replacing your hosts file manually can be as simple as running Wget. Example for a linux environment:

sudo wget -O /etc/hosts https://adaway.org/hosts.txt

Of course, as /etc/hosts is a system file (on Linux and Android alike; on the latter, it can be found in a different location, on the read-only /system partition), this requires root access. Similarly on Windows systems, you will need to do this with the Administrator account. As for keeping it up-to-date automatically, there's always Cron on Linux, and AFAIK also something similar on Windows.

A similar solution is offered by AdFree, which also was banned from Google Play. I've tried both in the past, and they do what they say.

AdFree is an alternative to AdAway (click image for larger variant)


On Windows, there is PeerBlock. It is freeware. I don't know if it interacts with the hosts file, but it blocks adware and spyware hostnames and IPs:

enter image description here

It automatically updates its blocklists:

enter image description here

You can edit blocklists and download new ones from iblocklist.com

enter image description here

  • I fixed your link to iblocklist.com (no s, as that's a spam domain) May 19 '14 at 2:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.