Yes, you can block ads across all devices on your home network by configuring your router to use DNS-based ad filtering, which stops ads at the network level before they reach any device.
What You'll Need
- A router that supports custom DNS settings or third-party firmware (such as OpenWrt, DD-WRT, or AsusWRT-Merlin)
- Access to your router’s admin interface (typically via a web browser at 192.168.1.1 or 192.168.0.1)
- Admin username and password for the router
- A stable internet connection
- (Optional) A computer or smartphone to configure the router
Step-by-Step
- Connect to your router’s admin interface by opening a web browser and entering the router’s IP address (commonly 192.168.1.1, 192.168.0.1, or 10.0.0.1; check the label on the router or your device’s network settings if unsure).
- Log in using the admin username and password. If you’ve never changed these, they are often printed on the router label (e.g., admin/admin or admin/password). If you’ve forgotten them, you may need to reset the router to factory settings.
- Navigate to the DNS settings section. This is usually found under Network, WAN, or Internet settings. Label names vary by router brand and firmware version—look for fields labeled “DNS Server,” “Static DNS,” or “Domain Name Server.”
- Replace the default DNS servers (often provided by your ISP) with those of an ad-blocking DNS service. Recommended options include:
- AdGuard DNS: 94.140.14.14 and 94.140.15.15
- NextDNS: 45.90.28.0 and 45.90.30.0 (requires free account setup at nextdns.io for full features)
- Cloudflare Family: 1.1.1.2 and 1.0.0.2 (blocks malware and adult content; limited ad blocking)
- Save the changes. The router may reboot automatically; if not, manually restart it to ensure the new DNS settings take effect.
- Verify the change by checking a device connected to the network. On Windows, open Command Prompt and run
ipconfig /all; look for “DNS Servers” under your active connection. On macOS or Linux, usescutil --dnsor check Network Settings. The displayed DNS should match the ones you entered. - Test ad blocking by visiting a site known for displaying ads (e.g., a news website). Ads should be noticeably reduced or absent. You can also use tools like
nslookup doubleclick.net—it should return a non-routable IP or NXDOMAIN if blocked.
Common Mistakes
- Entering incorrect DNS IP addresses (e.g., transposing digits), which can break internet connectivity.
- Forgetting to save or apply changes before exiting the admin interface.
- Not restarting the router after changing DNS settings, leaving the old configuration active.
- Using DNS-over-HTTPS (DoH) or DNS-over-TLS (DoT) settings on individual devices, which can bypass the router’s DNS settings.
- Assuming ad blocking works instantly—some devices cache DNS results and may need a restart or DNS flush (
ipconfig /flushdnson Windows,sudo dscacheutil -flushcacheon macOS).
Tips
- If your router doesn’t allow custom DNS in the stock firmware, consider installing third-party firmware like OpenWrt or DD-WRT (only if your router model is supported—check the official compatibility lists first).
- For more granular control, use a service like NextDNS, which lets you block specific domains, enable logging, and set up allowlists via a web dashboard after creating a free account.
- Combine router-level DNS filtering with browser-based ad blockers (like uBlock Origin) for layered protection against ads that bypass DNS filtering (e.g., inline scripts or first-party ads).
- Periodically check that your DNS settings haven’t reverted—some ISPs push updates that override custom DNS, or a router firmware update may reset settings.
- Enable DNSSEC if available in your router settings for added security against DNS spoofing.
Troubleshooting
- No internet after changing DNS: Double-check the DNS IP addresses for typos. Revert to your ISP’s default DNS or set to 8.8.8.8 and 8.8.4.4 (Google) or 1.1.1.1 (Cloudflare) to restore connectivity, then re-enter the ad-blocking DNS carefully.
- Ads still appearing: Confirm the device is using the router’s DNS (not a custom DNS or DoH/DoT setting). Flush the DNS cache on the device. Wait 5–10 minutes for changes to propagate. Test with a site like
ads.google.comusingnslookup—it should not resolve to a real IP. - Some ads still show (e.g., on YouTube or in apps): These often come from the same domain as the content (first-party ads) or use IP addresses directly, bypassing DNS filtering. Router DNS blocking cannot stop these—consider browser extensions or app-specific solutions.
- Router interface won’t load or login fails: Try a different browser, clear cache, or use Ethernet instead of Wi-Fi. If login credentials fail, perform a factory reset (hold reset button 10+ seconds) and use default credentials—note this erases all custom settings.
Frequently Asked Questions
Will this slow down my internet?
No—DNS filtering adds negligible latency. In fact, blocking ad domains can slightly improve page load times by preventing unnecessary connections.
Can I still access websites if their ad domains are blocked?
Yes—blocking ad domains only stops requests to known advertising or tracking servers. The main website content loads normally unless it’s hosted on a blocked domain (rare for legitimate sites).
Do I need to configure each device individually?
No—once set at the router level, any device that obtains its DNS automatically via DHCP (the default) will use the ad-blocking DNS. Static DNS settings on a device will override this.
Is this legal and safe?
Yes—using public DNS services to filter content is legal and safe. It does not modify or intercept your data; it only prevents certain domain lookups from resolving.
What if my router doesn’t support custom DNS?
Check if your router model supports third-party firmware like OpenWrt. If not, consider using a DNS-filtering device (like a Pi-hole on a Raspberry Pi) connected to your network, or configure DNS on each device individually.
Will this block all ads?
No—it blocks ads served from known domains listed in the DNS filter’s blocklists. It cannot block first-party ads, ads embedded in video streams, or ads served via IP addresses without domain lookups.