Are there ways that attempt to block ads in applications? It seems that it should be theoretically possible, by blocking web requests to certain sites, for example.


11 Answers 11


The most popular method is replacing the built-in hosts files with one that forces DNS queries to well-known ad servers to result in (localhost). This effectively blocks most common ads, and most of the Google Ads in applications.

The downside is that applications can tell that ads are being blocked, and can either refuse to run or otherwise degrade their usefulness while the ad blocking is in effect.

Also, root access is required to replace the hosts file.

Beyond that, I haven't seen anything that can selectively block web requests for arbitrary apps. For some programs that only use internet access for ads, you could use a firewall app to prevent them from accessing the internet or -- if your ROM supports it (like the latest CyanogenMod) -- revoke the internet access permission from the app.

Again, root access is generally required to set up a system-wide app-level firewall or replace your ROM.

  • 4
    Note that there are apps for this, e.g. "Ad Free Android" or "AdAway". A search turns them up quickly. Commented Oct 6, 2011 at 17:27
  • 1
    IMO It's better to redirect to
    – Broam
    Commented Oct 6, 2011 at 20:45

There are two different apps, AdFree Android and AdAway that block ads, theoretically in all applications. You must have a rooted phone in order to use these.

AdFree Android works by

...nullifying requests to known host names in the system hosts file.

which is essentially an automated solution of modifying the hosts file, brought up by another user here. It appears that Adaway does the same thing.

If you do not have a rooted phone, you can, at the very least, use the Firefox Browser with the Adblock Plus AddOn (installed via Firefox).


You can use an ad-blocking DNS server such as AdGuard DNS. Unlike the HOSTS file method, you won't need to use an app, nor root your phone.

On ​​Android 9 Pie and later, you can use ad-blocking DNS servers by configuring the Private DNS setting:

  1. Go to Settings → "Network & internet" or "Wi-Fi & Internet" or "Connections".

  2. Select "Advanced" or "More connection settings" → "Private DNS".

  3. Select the "Private DNS provider hostname". Enter dns.adguard.com. (This is the AdGuard DNS hostname. If using another ad-blocking DNS, then replace it with the corresponding hostname.) Press "Save".

For versions prior to Android 9 Pie:

  1. Go to "Settings" → "Wi-Fi".
  2. Press and hold the name of the Wi-Fi network you are currently connected to.
  3. Select "Modify network".
  4. Tick the "Advanced options" checkbox.
  5. Change "IP Settings" to "Static".
  6. Remove the DNS addresses that may be already listed and replace with for DNS 1 and for DNS 2. (These are AdGuard DNS IP addresses. If using another ad-blocking DNS, then replace them with the corresponding IP addresses.)
  7. Press "Save". You may need to disconnect from the Wi-Fi network and reconnect for the changes to take place.
  8. Note that if the "Save" button is grayed out, manually re-enter the current values into the "IP address", "Gateway", and "Network prefix length" text fields. Then press "Save", which should become active by this point.

Aside from the DNS / IP address-based ad blockers, I'd also recommend MinMinGuard (requires a rooted phone and the Xposed Framework). It features API-based blocking, where function calls provided by the advertisement network SDK are blocked.

MinMinGuard is an Ad-remover made with Xposed Framework for Android. MinMinGuard can completely remove both the ads inside apps and the empty space caused by those ads. Conventional ads removing apps are only able to block the ad content, but the space taken by the ad will still remain unused (black). MinMinGuard successfully removes that black space, which extends the app window and makes your user-experience better!


  • Totally remove the advertisement. You can notice that AdBlock and AdAway only stops showing the ad content, but it can not remove the empty field that was originally taken by the ad. MinMinGuard can totally remove the empty field!
  • Lightweight. Alternative ad removing apps (AdBlock etc) constantly run a background VPN service, which puts a heavy loading on the system. MinMinGuard does not need to run a VPN service, so it saves system resources and, thus, extends the battery life.
  • Per App Setting. MinMinGuard lets you choose which apps you want to remove ads from. If you only want to remove ads from several apps, MinMinGuard is your best solution.

MinMinGuard screenshot


You can also use a firewall or permissions-limiting application (DroidWall or LBE Privacy Guard, for example) to limit internet access for particular applications. These also require root.


To disable ads, you have to understand where the ads actually come from. There are easy-to-identify ad servers, and those can be easily avoided by editing your hosts file (you can edit hosts file on a rooted phone through ES file manager, or from a terminal session be it local or from your laptop/desktop).

But when the ad servers keep having random subdomains, that can be a real chore to keep chasing those updated servers. There are applications (previously mentioned) that help to ease that task--but it still is the same solution of getting hit with ads--and then blocking the new servers. None of those methods work if the ip address gets hardcoded in. That is the trump card.

Another option is to enable a firewall that denies ANY traffic for a specific application. That means: updates, ads, pushing your stats, etc...don't use your data plan and don't tie up your phone. Avast! Mobile security (free on marketplace or Play) gives you granular control when you want it. I have used Avast on desktops and servers, and run it on rooted Gingerbread and CyanogenMod9 (ICS). Very good appl.


Adblock Plus is now available for Android.

Here's a snippet from Lifehacker's review:

If you love Adblock Plus on the desktop, now you can take it with you on your Android phone. Adblock Plus for Android blocks ads on sites while you browse and even suppresses ads inside of ad-supported applications. Best of all, it's completely free.

Adblock Plus for Android doesn't require root access to your phone to suppress ads, but works best if your device is rooted. If you're rooted, it'll suppress ads over 3G/4G and Wi-Fi with no additional configuration required. If you're not rooted and you're running Ice Cream Sandwich, it'll block ads over Wi-Fi but not 3G/4G. If your device is running Gingerbread or earlier, you'll have to set up Adblock's proxy manually to get it to work. Speaking of proxies, that's how Adblock Plus for Android manages to strip out all of those ads: it routes all of your traffic through their servers, and removes the ads before it gets to your phone.

  • The article also notes: ".. it's important to note that the only reason so many great Android apps remain free are because the ads support the developers..." If too many people block the ads in Android apps, there will be fewer high-quality free apps.
    – ale
    Commented Nov 27, 2012 at 14:20

Although incomplete I have a solution in place that is sufficient for me. I have configured the dnsmasq dns server in my lan to serve as the response to a specified set of advertising hostnames.

The pro is that I have one solution that fixes this for both my tablet and my phone without the need to root either of them. The con is that it only works at home on my wifi.


I like the firewall approach. Recently installed the NoRoot Firewall and by trial and error found that if I block access to l[ab]-in-f[0-9]{3}\.1e100\.net (actually, the app doesn't support regex in addresses), ads don't get through.


I had similar problem before and non of the existing apps could solve my problems, furthermore I cannot root my company phone due policy. Then I realized that you can configure proxy for each and every connection (wifi and 4g) separately. So I installed a squid, configured to block most of the annoying ad sites and deployed in docker. Long story short:

docker run -d -p 3128:3128 --name squid-adblock andrassebo/squid-adblock

Then configure the proxy on your phone to use the hosting machines IP address and 3128 as port.

If you would like to check details or simply compile your own image, the source code is available on GitHub: source and DockerHub: images


The latest Android Market app (I have 3.15 which is the first time I've noticed the option) has an option to allow you to prevent Google or AdMob ads from tracking you and personalizing the ads to your interests. If that's all you want to stop, then it's just a tickbox away.

Open the Market app, pressMenu scroll down to the Other Settings heading where you should see:

Google AdMob Ads: personalize ads based on my interests

Choose whether to personalize ads from Google and AdMob in mobile apps on this device. Learn more

Just remove the tick from that tickbox to:

Opt out

If you opt-out, your device identifier information will not be used by Google for advertising going forward and you will not receive ads based on your interests or inferred demographics.

  • 2
    I don't think that's to say you won't receive ads at all, just that you won't receive targeted ads.
    – ale
    Commented Oct 6, 2011 at 14:43
  • @AlEverett That is true, which is why I said "tracking you and personalizing the ads to your interests. If that's all you want to stop" it's also worth noting that it also only works for the Google/AdMob/Android default ad services, if an app is serving 3rd party ads that option won't do anything.
    – GAThrawn
    Commented Oct 6, 2011 at 14:46
  • I was just adding clarity.
    – ale
    Commented Oct 6, 2011 at 14:58

The answer is: theoretically yes, practically no. Several years passed since the question, but adware got even worse.

Best way to "block ads" is to "get rid of code that produces it". This is very hard to achieve, because this would require to get rid of adware roots, which are related to current world's economical model and entrepreneurship. It's like to rehabitate all people around the world, to react ads very drastically and ultimative: "either no ad, either no use of android os/devices". This could happen through children education, via seeding strong idea, like "ads is something criminal like porn/theft/deception and speculation/terrorism/narcotics"... In such way, after several human generations adware would eventually starve, because any "ad-related activity" would refer to organisation which will be considered "codnucting illegal activity" and enormous penalty tax should be applied, and person who publish ad jailed.

There exists other, faster way: It is to create a group, who would develop android alternative firmware, essentially same as android, but with licensing terms explicitly disallowing using of ads, and maybe even some banning/firewall engine, embedded into system and easily tunable by users. Good implementation would be very costly, and it would take time to put it on a very single phone. But that would definetely force android community to react.

That is some effective approaches, but any real action should involve Google, which should "change its mind and become white and fluffy" in order to really get rid of adware in android. This is very unlikely to achieve, with current world's economical model.

  • 1
    Sorry, but this is not helping us to fix the issue at hand immediately. We tend to avoid opinions because we are not a forum. Please consider providing a technical solution to the problem, even if it is just about installing an app and using it to block ads
    – Firelord
    Commented Nov 1, 2018 at 16:51
  • @Firelord Pease Please, reread question title: there was nothing like "it is just about installing an app". Also, "this is not helping us" - who is "us"? Are you on behalf of some organisation? Please use correct and understandible wording.
    – xakepp35
    Commented Nov 1, 2018 at 19:48
  • @Firelord Good answer is not about developing app, but more about "undeveloping what was developed by human error". No app would solve this ever. Correct technical solution is: to spend next century in attempt to change people mind in such a way, that people would not participate in developing/using adware. Add ad-related stuff - firmwares, os, libraries, etc - could be just abandoned. Steps could involve politics, informing, education, so on. "Would they be taken or not?" / "Easy solution or a hard one?" - these are out of discussion scope. But it IS a solution, and is ONLY correct solution.
    – xakepp35
    Commented Nov 1, 2018 at 19:53
  • You are right. Current world's politico-economic system which is heavily based on capitalism, is strongly tied to competition and hence advertisement. But in our case, “practically no”? No. I haven't seen a single ad (if I didn't miss one) on my device for past few years. The only thing I do is DNS filtering. Commented Oct 25, 2019 at 12:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .