sodcalculator

10 Tech How-To

Block Ads Network Wide at the Router Level

Guide 10-44917 · Updated · Step by step

This guide shows you how to block ads on every device connected to your home Wi-Fi or wired network by configuring your router. Instead of installing ad blockers on each phone, laptop, or smart TV, you set up a DNS-based filter that rejects known ad and tracker domains before they load. You’ll need router admin access and a few minutes to change one or two settings.

What You’ll Need

  • Access to your router’s admin panel (usually via a web browser at an address like 192.168.1.1 or 192.168.0.1).
  • The router’s admin username and password (often printed on a sticker on the router or in its manual).
  • A DNS service that offers ad blocking, or a list of ad-blocking DNS servers (free options exist).
  • Optional: a computer or phone connected to the network to test after changes.

Step-by-Step

  1. Find your router’s IP address. On Windows, open Command Prompt and type ipconfig; look for “Default Gateway.” On macOS, go to System Settings > Network, select your connection, and click Details; the router IP is listed under Router. On a phone, check the Wi-Fi settings for the gateway or router address.
  2. Log into the router’s admin panel. Open a web browser and type the router IP into the address bar. Enter your admin username and password. If you don’t know them, try common defaults like “admin” for both, or look on the router’s sticker. If you’ve changed them and forgot, you may need to reset the router (see Troubleshooting).
  3. Locate the DNS settings. Look for a section called “Internet,” “WAN,” “Network,” or “DHCP.” Some routers list DNS under “Advanced” or “Setup.” You’re looking for fields labeled “DNS Server” or “Primary/Secondary DNS.”
  4. Choose an ad-blocking DNS service. The most common free option is AdGuard DNS (primary: 94.140.14.14, secondary: 94.140.15.15). Another is CleanBrowsing Family Filter (185.228.168.168 and 185.228.169.168), which also blocks adult content. You can also use a custom DNS list like Pi-hole, but that requires a separate device. For this guide, we’ll use AdGuard DNS.
  5. Enter the DNS server addresses. In the DNS fields, replace the existing numbers with the primary and secondary addresses from your chosen service. Save the changes. The router may restart or disconnect briefly.
  6. Clear your device’s DNS cache. On Windows, open Command Prompt and type ipconfig /flushdns. On macOS, type sudo dscacheutil -flushcache and press Enter. On smartphones, toggling Wi-Fi off and on usually clears the cache.
  7. Test the ad blocking. Visit a website that’s known for heavy ads, like a news site, and see if ads are gone. You can also visit a site like adblock-test.com to verify. If ads still appear, your router may be using its own DNS cache; reboot the router.

Common Mistakes

  • Entering the DNS in the wrong place. Some routers have both a “DNS” setting for the WAN (internet connection) and a “DNS” setting for the DHCP (local network). You want the one that assigns DNS to clients. Usually it’s the WAN or Internet DNS.
  • Using the router’s default DNS. If you don’t change the DNS, your router will use your ISP’s DNS, which doesn’t block ads.
  • Forgetting to clear the DNS cache. Even after changing DNS, your devices may remember the old DNS results for a while. Flush the cache or restart the device.
  • Typing the IP addresses incorrectly. A single wrong digit will break internet access. Double-check each number.
  • Assuming all ads are blocked. DNS-based blocking only blocks ads from domains that are on the filter list. Some ads come from the same domain as the content (like YouTube ads) and won’t be blocked. Also, some websites use their own domains for ads, which may not be in the list.

Tips

  • Use a dedicated ad-blocking DNS for more control. AdGuard DNS also offers a family protection version (94.140.14.15 and 94.140.15.16) that blocks adult content. You can switch between them anytime.
  • Test with a single device first. Before changing the router DNS, you can set a single device to use AdGuard DNS manually. If it works there, then apply it to the router.
  • Write down your original DNS settings. If you ever need to revert, you’ll know what to put back. Usually your ISP’s DNS is automatically assigned, so you can also just set the router to “Obtain DNS automatically.”
  • Consider a hardware ad blocker. If you want more advanced filtering (like blocking by IP or custom rules), a device like a Raspberry Pi running Pi-hole is a popular option, but it requires more setup.

Troubleshooting

  • Internet stops working after changing DNS. You likely typed the IPs wrong. Re-enter them carefully. If it still fails, revert to automatic DNS and test again.
  • Ads still appear. Check that the DNS settings were saved and that your device is using the router’s DNS. On your computer, run nslookup example.com (Windows) or dig example.com (macOS/Linux) and see if the server shown is your new DNS. If it’s not, your device may have a manual DNS set in its network settings—remove that.
  • Some sites break or load slowly. The ad-blocking DNS may be blocking a resource that a site needs. Try a different DNS service, or if you use CleanBrowsing, switch to the non-family version. You can also allowlist domains if your router supports it, but that’s advanced.
  • Router admin page won’t load. Make sure you’re connected to the network (Wi-Fi or cable). Try a different browser or an incognito window. If you’ve changed the router IP, use the default gateway IP from your device.
  • Forgot the router admin password. Most routers have a reset button (usually a small pinhole). Hold it for 10-30 seconds with a paperclip. This resets all settings, including the password, to factory defaults. You’ll need to reconfigure your network afterward.

Frequently Asked Questions

Will this block ads on my phone when I’m on cellular data?

No. The router only affects devices connected to your home network. On cellular, you’d need a separate DNS setting on your phone (Android and iOS allow custom DNS in Wi-Fi settings, but not always for mobile data).

Does this slow down my internet?

Usually not. DNS lookups are quick, and ad-blocking DNS servers are fast. You might even notice faster page loads because ad requests are rejected before they load.

Can I bypass the block for a specific device?

Yes, if your router supports per-device DNS assignments. Otherwise, you can set that device to use a different DNS (like Google’s 8.8.8.8) manually in its network settings, but that’s a bit technical.

Will this block ads on YouTube or in apps?

It may block some, but not all. YouTube ads come from the same domain as the video, so they won’t be blocked. In-app ads that use a separate ad domain may be blocked, but many apps use in-house ad networks.

Is this safe to use?

Yes, using a reputable DNS service like AdGuard or CleanBrowsing is safe. They only filter known ad/tracker domains and do not see your browsing history beyond DNS queries. Avoid unknown DNS services, as they could be malicious.

What if I want to block more than ads, like malware or adult content?

AdGuard Family and CleanBrowsing Family Filter block malware and adult content as well. You can also use a service like NextDNS, which lets you customize blocklists and create a personal DNS profile.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →