Ads are pretty annoying. A few ads here and there are fine, but seeing them every day and on every app launch? That’s just unacceptable. Whether it’s in your web browser or on your phone, ad blocking can save you time and protect your privacy. Today, I’m going to talk about how to block ads on every platform and devices. So let’s start with my favorite mobile platform, Android.
Rooted Android – /etc/hosts
I love Android because it is hackable and you can do so much more than you ever imagined with an Android device. For example, you can root your phone and install ad-blocker that can block system-wide ads. Or you can uninstall unwanted system apps or even install a custom ROM.
When it comes to ad-blocking on a rooted device, AdAway is the app you want. It modifies system’s hosts file to filter out ads and tracking domains. It doesn’t consume any extra battery and works system-wide – even in your browser.
- Root you device using Magisk. Just kidding, don’t root unless you know the consequences. Or you already have a rooted device otherwise why read this? Rooting is a complex process and you could brick your device. Magisk provides systemless root solution and a systemless hosts module, so AdAway can modifying the hosts file without touching system files directly. Pretty cool.
- Enable the systemless hosts module in Magisk settings.
- Install AdAway, a free and open-source app. You won’t find this app in the Play Store because app like this violates Google’s policies. Some developer also prefer to skip extra effort required to publish their apps on the Play Store and only publishes them independently.
- Activate ad blocking in AdAway – and enjoy an ad-free experience. You can also whitelist or blacklist domains as you wish which gives you full control over ads blocking.
Not everyone roots their device. And for iOS? I get that too.
Android / iOS – DNS Based
While using hosts file you get some fine grained control, in DNS based ad-blocking it depends on what DNS provider you pick. What is DNS server? In simple words, a DNS server resolves a domain name (like sangams.com.np) to an IP address, which points to the server hosting the website. So, if a DNS server blocks ad service domains, you won’t get the ads. Here is a list of some ad-blocking and privacy focused DNS providers.
Ad-Blocking DNS Providers
- Control D – My favorite, free, no limits, no signup and comes with predefined configuration settings
- Quad9 – Free, no limits
- NextDNS – Freemium, signup required, monthly limit and configurable
- AdGuard – Freemium, no signup required, monthly limit and configurable
Android Configuration
I am not going to show step by step guide so if you don’t know what to do read this – https://developers.cloudflare.com/1.1.1.1/setup/android/#configure-1111-manually for step by step guide. But you should be smart enough to replace Cloudflare DNS hostname with yours.
- Search for Private DNS in settings. You can find it under Network & internet or Connectivity options.
- Put DoT (DNS-over-TLS) hostname you get from DNS provider. For example I use
no-ads-porn.freedns.controld.com
from Control D under Custom Configuration, which blocks ads, tracking and adult content. You can pick any from Standard Configuration, Custom Configuration or even Third Party Configuration.
Sometime you just want to toggle it on and off. But every time you need to open connectivity settings, still annoying. There is an app, Private DNS Quick Setting that creates Quick Setting Tile to toggle private DNS setting. However this app needs special permission to operate which can be granted using adb
, root or Shizuku. Use the following command to grant permission using ADB.
adb shell pm grant com.flashsphere.privatednsqs android.permission.WRITE_SECURE_SETTINGS
Code language: Shell Session (shell)
For non technical user, here is guide on how to install adb and use it – https://www.xda-developers.com/install-adb-windows-macos-linux
iOS Configuration
Other than excellent hardware, everything Apple makes is crap. Sorry if I offended you. Unlike Android configuration is not straight forward in iOS and you need to create a configuration profile
For the simplest solution, go to https://encrypted-dns.party/ and pick one ad-blocking DNS profile and use it. I recommend using Control D and DoH hostname. Or you can create your own profile using https://dns.notjakob.com/tool.html.
- If you downloaded the configuration file using Safari it will ask you to install. If downloaded with other browser you have to install it manually.
- To install go to System Settings > General > VPN, DNS & Device Management, select downloaded profile and tap the Install button.
Notes:
- Some DNS enables restricted mode and YouTube comments will be disabled, generally family friendly options. In that case pick another DNS options like ads and tracking.
- Some network doesn’t work with private DNS in that case you need to disable it.
Difference between DoH and DoT – https://www.cloudflare.com/learning/dns/dns-over-tls/
YouTube Ads on Mobile App (Android Only)
Root or DNS based ad-blocker can’t block ads in YouTube mobile app. There is a patched YouTube app called YouTube Revanced. Previously there was YouTube Vanced which was taken down by Google. Be aware there are many fake websites and don’t install APKs from unknown websites. You need to patch the original YouTube APK yourself to use it.
Another option is to use Firefox browser with uBlock Origin extension. Firefox mobile app also supports uBlock Origin extension and can block ads.
PC – Mac, Windows or Linux
Unlike mobile platforms, ad networks generally don’t target PC platforms, so PC platform don’t have apps with ads. And because we don’t need to worry about PC apps, system-wide ad blocking is not necessary at all. The only place you see ads while using a PC is while browsing the web. If you block ads in the browser, you theoretically blocked 99.9% ads. That remaining 0.1% is for Microsoft ads embedded into Windows, which is really hard to avoid. So what are best way to block ads in you browser?
Browser with Ad-blocking extension
My personal favorite is Firefox with uBlock Origin. uBlock Origin is the best ad blocking extension out there and it works best with Firefox. It also works great with Chromium based browser like Google Chrome and Microsoft Edge. However with recent updates with Google’s extension framework – Manifest V3, it prohibits ad-blocking extension to work on their full potential. uBlock origin have its lite version uBlock Origin Lite made for Chromium based browser. It is limited but still work really good.
Browser with Built-in Ad-blocker
Browser like Brave have built-in ad-blocker and there is no need to install any extension. It also blocks YouTube ads.
YouTube Ads
Apart from blocking ads on websites, they also blocks YouTube ads, which is a huge relief. There is another extension called SponsorBlock that helps to skip sponsor from video creators. uBlock Origin combined with SponsorBlock gives you the best YouTube experience, just like back in the days before Google rolled out unskippable ads.
There are plenty of ad-blocking apps that promise a lot but can’t be trusted. Stick to reputable extensions or DNS services instead. They may do more harm than good. That’s all for now. Thanks for reading.