Block Ads on Every Device Without Browser Extensions
In this article
Blocking ads across all your devices without using browser extensions is possible by filtering ads at the network level—specifically, through your home router or a local DNS server. This method works for every device on your network (phones, smart TVs, game consoles, computers) and even on mobile data if you configure a private DNS. You’ll need a router that supports custom DNS settings or the ability to flash custom firmware (like DD-WRT or OpenWrt). If your router doesn’t allow that, you can run a lightweight DNS server on a Raspberry Pi or an old PC. This guide walks you through the most common approach: using a DNS-based ad blocker like Pi-hole, or simply pointing your router’s DNS to a public ad-blocking DNS service.
What You'll Need
- A router with admin access (to change DNS settings or install custom firmware).
- Optional: A Raspberry Pi (or any always-on computer) if you want to run Pi-hole.
- Optional: An account with a DNS service that blocks ads (e.g., NextDNS, AdGuard DNS) if you prefer a cloud solution.
- Basic familiarity with your router’s admin panel.
Step-by-Step
- Choose your method: Decide between (A) using a public ad-blocking DNS service (simplest) or (B) running your own DNS blocker like Pi-hole (most control). For method A, you just change your router’s DNS settings. For method B, you’ll set up a small device to act as your network’s DNS server.
- For method A – Change router DNS: Log into your router’s admin panel (usually via a browser at an IP like 192.168.1.1 or 192.168.0.1). Find the WAN or Internet settings section. Look for “DNS” or “DNS Server” fields. Replace the current DNS addresses with the ones from your chosen ad-blocking DNS provider (e.g., for AdGuard DNS: 94.140.14.14 and 94.140.15.15; for NextDNS, you’ll get unique IPs after creating an account). Save and apply the settings. Reboot the router if prompted.
- For method B – Set up Pi-hole: Install Pi-hole on a Raspberry Pi or a Linux machine. Download the Pi-hole installer from the official website, run it in the terminal, and follow the prompts. It will ask for a static IP address for the device—assign one outside your router’s DHCP range to avoid conflicts. After installation, note the Pi-hole’s IP address.
- Point your router to Pi-hole: In your router’s admin panel, go to the DHCP or LAN settings. Set the DNS server that the router hands out to clients to the Pi-hole’s IP address. This makes all devices on your network use Pi-hole for DNS queries. Save and reboot the router.
- Test that ads are blocked: On any device, visit a website known for ads (e.g., a news site). If ads are gone or replaced by blank spaces, it’s working. You can also check the Pi-hole dashboard (if using method B) to see blocked queries in real time.
- For mobile devices on cellular data: To block ads on your phone when not on Wi-Fi, go to your phone’s network settings and set a private DNS. On Android, go to Settings > Network & Internet > Private DNS and enter the hostname of your ad-blocking DNS provider (e.g., dns.adguard.com). On iPhone, you’ll need to download a configuration profile from your DNS provider or use a DNS app—this is more involved, but many providers offer simple setup guides.
Common Mistakes
- Forgetting to set a static IP for the Pi-hole device—if it changes, your network breaks.
- Typing the DNS IPs incorrectly—double-check for typos.
- Not clearing your device’s DNS cache after changing settings—old entries may persist.
- Using a DNS service that blocks too much (e.g., breaks some websites) and not whitelisting necessary domains.
- Assuming the router’s “DNS” setting under WAN is the same as the DHCP DNS—they are different; you need to change the one handed to clients.
Tips
- If you use Pi-hole, regularly update its blocklists (via the admin panel) to keep up with new ad domains.
- For method A, choose a DNS provider that allows custom filtering—so you can allowlist or blocklist specific domains.
- Set your router’s DHCP lease time to a short value (e.g., 1 hour) when testing, so devices pick up new DNS settings quickly.
- If you have a large household, Pi-hole gives you a nice dashboard to see which devices are making the most queries.
- For non-technical users, method A is far easier—just change two numbers.
Troubleshooting
Ads still appear: First, confirm your device is actually using the new DNS. On a computer, open a command prompt and run ipconfig /all (Windows) or cat /etc/resolv.conf (Linux/macOS). If the DNS IP is not what you set, your router might not be pushing it—check DHCP settings. Also, some devices (like smart TVs) may have hardcoded DNS; you’ll need to change it manually in their network settings.
Internet stops working: If you lose connectivity after changing DNS, revert to automatic DNS in your router. Then check if the DNS server you chose is reachable (ping it from a computer). If using Pi-hole, ensure it’s powered on and connected to the network.
Some websites break: This happens when a site relies on domains that are also used for ads. In Pi-hole, check the query log and whitelist the domain that’s being blocked. For cloud DNS, add the domain to your allowlist.
Pi-hole not blocking anything: Verify that the Pi-hole service is running (sudo systemctl status pihole-FTL). Also, ensure that your router is actually handing out the Pi-hole IP as DNS—sometimes the router’s own DNS setting overrides it.
Frequently Asked Questions
Will this block ads in apps on my phone?
Yes, DNS-based blocking works for most in-app ads, because they are served from ad domains. However, some apps may embed ads directly in their content or use the same domain for the app and ads, which could cause issues.
Does this slow down my internet?
Usually not—DNS lookups are tiny and fast. Pi-hole on a Raspberry Pi can handle hundreds of queries per second. If you use a cloud DNS, the extra hop might add a few milliseconds, but it’s often imperceptible.
Can I block ads on my smart TV?
Yes, as long as the TV connects to your home Wi-Fi and uses your router’s DNS. Some smart TVs have their own DNS settings, but most will follow the router’s. If not, you can manually set the DNS on the TV.
Is this legal?
Yes, blocking ads on your own network is legal in most jurisdictions. It’s your right to control what content your devices load. However, some websites may detect ad blocking and restrict access—that’s their choice.
Do I need to keep my computer on for Pi-hole to work?
Yes, the device running Pi-hole must be on 24/7 for continuous blocking. If it goes offline, your network will lose DNS resolution unless you set a fallback DNS in your router. Consider using a low-power device like a Raspberry Pi.
Can I use this method on public Wi-Fi?
No, you can’t change the DNS on public Wi-Fi networks. However, you can set a private DNS on your phone (as described in Step 6) which works on any network, including public Wi-Fi.