Skip to content

Behind the scenes

What a DNS Filter Can and Cannot Block on Android Phones

By the llcloud team 6 min read

Quick answer

A DNS filter such as Repel blocks the lookups apps make for tracker, ad network, malware and phishing domains, so those connections never start. It cannot block ads served from the same domain as the content, such as YouTube's, ads built into an app, or lookups an app sends over its own encrypted DNS. It decides which names can be found, never what a page or app shows.

When we built Repel, one of the first things we wrote down was what a DNS filter cannot do. People install a blocker expecting every ad to vanish, and when a YouTube ad plays anyway, the blocker looks broken. It is not. DNS filtering is a specific tool with a specific reach, and knowing where that reach ends makes it far more useful. This post explains how it works, what it is good at, and what slips past it on any Android phone.

How does a DNS filter work?

It answers the question every app asks before it connects: where does this name live? Apps reach servers by name, such as an analytics domain or an image host. Before connecting, the app asks the phone's resolver for the address behind that name. That question is a DNS lookup, and a DNS filter sits in front of it.

On Android without root, the way to sit there is the VPN service. Repel's filter runs a local VPN that carries one virtual DNS address and nothing else. Every app's lookups arrive there. Their other traffic goes over the normal network, untouched, which is why the filter is light on battery. Android's own documentation notes there is only one active VPN service per user, so this layer takes the slot. That is why Repel's app firewall and one-tap Private DNS are built to work without it.

Each lookup is checked against the blocklists you choose. A listed name gets an answer that leads nowhere: the address 0.0.0.0, or its IPv6 twin. We answer that way, instead of with silence, so the app fails fast on a dead address rather than retrying. A name that is not listed goes out encrypted with DNS over HTTPS to the server you picked, and the real answer comes back.

Blocked answers carry a short lifetime of one minute. Android remembers DNS answers for as long as they say, and we want an allow rule to take effect quickly when a list catches something you need.

What can a DNS filter block?

It blocks anything that lives on its own domain and that you can name in a list. That is a lot of what apps do in the background:

  • Tracking and analytics. Most of these endpoints exist only to collect data, so blocking them costs the app nothing it needs.
  • Many ad networks. When an app pulls ads from a separate ad company's domain, the lookup fails and the slot stays empty.
  • Malware and phishing. A link to a known bad domain goes nowhere, whichever app you tap it in.
  • Phone-maker telemetry. Some lists cover the reporting domains used by Samsung, Xiaomi, Huawei, OPPO, realme and vivo.

The lists do the heavy lifting. Repel uses community lists such as HaGeZi, OISD, 1Hosts and StevenBlack, which are maintained by people who spend their time finding these domains.

There is one trick trackers use that we check for. A site can give a tracker a name on its own domain, such as a metrics subdomain, that points through a CNAME record to a tracking company. The first name looks harmless. When the answer comes back, Repel reads where it points, and if that target is on a blocklist, the lookup is blocked too. This is often called CNAME cloaking.

What can a DNS filter not block?

It cannot block anything it cannot tell apart by name. Three cases cover nearly every surprise.

Ads from the same domain as the content

If an app serves its ads from the same servers as its videos, posts or pages, the filter sees one name for both. Blocking it would break the app. YouTube is the best known example: its video ads come from the same domains as the videos, so they play. Repel does not block YouTube ads, and no DNS filter can. Other DNS filters say the same thing on their own store listings, because it is a fact about DNS, not about any one app.

Ads built into the app

Some apps ship their ads inside the app itself, or fetch them from their own servers along with everything else. There is no separate lookup to refuse.

Apps that skip the phone's resolver

An app can do its own DNS. Google's Android developers blog, introducing Private DNS, addressed apps that perform their own DNS queries. If an app sends its lookups over DNS over HTTPS to a server of its own choice, the phone's filter never sees them. An app can also connect straight to a fixed IP address and skip DNS entirely.

We close the commonest version of this gap. Browsers are the main apps with built-in secure DNS, and to use it they first look up their secure DNS server by name. Repel answers those lookups with "no such domain", so the browser falls back to the phone's resolver, which is the filter. Firefox also checks a special canary domain that Mozilla documents for networks that want its automatic secure DNS off, and Repel answers that the same way. This guard is free and on by default. It covers well-known secure DNS services, so an app pointed at a server of its own that nobody has listed can still go around it.

Why does the activity log sometimes miss lookups?

Because some lookups never happen. Android caches answers, so a site you opened a minute ago may not ask again. An app the firewall has cut off never gets as far as a lookup. And apps you have told to skip the filter are not routed through it at all. The log keeps the most recent lookups on the phone only.

What happens when the filter itself fails?

It steps aside rather than cutting you off. A filter that stops answering would leave every app unable to reach anything, which is worse than no filter. So on a Wi-Fi sign-in page, Repel lets lookups go to that network until you are online. If its DNS server stops answering for 30 seconds while your connection works, the filter turns off and a notification offers to turn it back on, unless a locked Family mode says otherwise.

So what is a DNS filter for?

The large, invisible background layer. Trackers, analytics, many ad networks, malware and scam domains, across every app at once, with one list and no per-app setup. Paired with an app firewall that can cut an app off completely, it covers most of what a phone sends out that you never asked for.

If you want to set it up, start with our guide to blocking ads and trackers in apps, or blocking trackers without a VPN if a VPN holds the slot. To stop an app going online at all, see how to block an app's internet access. For how the firewall avoids the VPN, read how Repel keeps your VPN slot free. Comparing tools? See NextDNS alternatives, Repel vs personalDNSfilter and our Private DNS guide.

Sources

Questions

Why can't a DNS filter block YouTube ads?

Because YouTube serves its ads from the same domains as its videos. A DNS filter only sees the name an app asks for, and answers yes or no for that whole name. Saying no would stop the videos too. Repel does not block YouTube ads, and no DNS filter or DNS provider can, whatever its blocklist.

What does a DNS filter block well?

Third-party domains whose only job is something you do not want: analytics and tracking endpoints, many ad networks, malware and phishing sites, scam shops and phone-maker telemetry. Apps call these in the background all day. Because the filter works below the apps, one list covers every app on the phone, including ones you cannot configure.

Can apps get around a DNS filter?

Some can. An app that resolves names itself over DNS over HTTPS never asks the phone, and an app that connects straight to a fixed IP address needs no lookup at all. Repel blocks the lookups that browsers use to find well-known secure DNS services, so they fall back to the phone's resolver, which is the filter.

Does a DNS filter see what I do on a website?

No. It sees the names your apps look up, such as a domain, and nothing about the pages, messages or files that follow. In Repel those lookups are checked on the phone, the log stays on the phone, and allowed lookups go out encrypted with DNS over HTTPS. Nothing about them is sent to us.

Keep reading