Setting Up AdGuard Home as a Network-Wide Ad Blocker

How I deployed AdGuard Home on my mini server to block ads across every device on my home network — without installing anything on each device.

5 min read

One thing I kept noticing on my phone and TV was that ads were everywhere — banner ads on news sites, tracking pixels loading in the background, Spotify audio ads cutting into whatever I was listening to. Installing a browser extension on each device was one option, but it felt like patching each boat individually instead of just fixing the water.

AdGuard Home solves this differently. Instead of running on each device, it runs on the network itself — as a DNS server. Every device that connects to my WiFi router sends its DNS queries through it, and AdGuard Home decides what resolves and what gets blocked. One deployment, every device protected.

How DNS Blocking Works

When your browser wants to open doubleclick.net, it first asks a DNS server: “what IP address is this domain?” A normal DNS server gives back the real IP. AdGuard Home intercepts that question and returns 0.0.0.0 instead — which means “this domain goes nowhere.” The browser tries to connect, fails immediately, and the ad never loads.

This is both the strength and the limitation of DNS-level blocking. It works regardless of the device, the browser, or the app. But it can only block or allow whole domains, not individual elements within a page. That distinction matters a lot for something like YouTube, where the ads are served from the same domains as the actual video — blocking the ad domain would break the video too.

The Setup

My mini server already runs Docker with Traefik as a reverse proxy, so I added AdGuard Home as another Docker service in the same proxy network.

The only real prerequisite was making sure port 53 was free. On Ubuntu 26.04, systemd-resolved holds port 53 by default as a local stub listener. The fix is straightforward — disable the stub listener, point /etc/resolv.conf at a real upstream DNS temporarily, then let AdGuard Home take over:

# /etc/systemd/resolved.conf
DNSStubListener=no
DNS=1.1.1.1 8.8.8.8

After restarting systemd-resolved, port 53 becomes available for AdGuard Home to bind to.

The Docker Compose setup is minimal:

services:
  adguardhome:
    image: adguard/adguardhome:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "3053:3000/tcp"
    volumes:
      - ./work:/opt/adguardhome/work
      - ./conf:/opt/adguardhome/conf
    networks:
      - proxy

For the web UI, I added a Traefik routing rule so it’s accessible at adguard.sultanmaula.com — the same pattern I use for every other service on this server.

Blocklists

AdGuard Home’s filtering is driven by blocklists — community-maintained lists of known ad, tracking, and malware domains. I enabled a stack of them:

ListRules
AdGuard DNS filter180,602
OISD Big233,852
Spotify Ads235,901
YouTube: BlocklistProject24,280
Dandelion Sprout’s Anti-Malware12,587
Peter Lowe’s List1,155
AdAway Default6,540

Total: around 695,000 rules covering ads, trackers, malware domains, and known Spotify ad servers.

Beyond the lists, I added a few manual rules for domains that matter specifically — doubleclick.net, googlesyndication.com, adservice.google.com, and several Spotify ad-serving subdomains.

The YouTube Question

The honest answer about YouTube ads and DNS blocking: it barely works.

YouTube serves its ads through the same infrastructure as its video content — googlevideo.com, youtube.com subdomains, Google’s CDN. There is no clean DNS-level separation between “this is an ad request” and “this is a video request.” Blocking the ad domains would break the video player entirely.

The blocklists I have block some YouTube-adjacent tracking domains, but the actual video ads that play before and during content are untouched by DNS. For those, the real fix is uBlock Origin in the browser, or YouTube ReVanced on Android. DNS blocking handles the rest of the network — YouTube ads in particular need a different tool.

A Small Detail That Improved Things

When AdGuard Home blocks a domain, the default behavior is to return no IP at all — the request just hangs briefly then fails. For ad images on websites, this shows up as a broken image icon in the page layout.

Switching the blocking mode to null_ip changes what gets returned to 0.0.0.0 with an immediate response. Browsers treat this as “connection refused” rather than “timed out,” so the failure is instant. More importantly, when the blocked resource was an image, the broken icon disappears — the space just becomes blank. Not a perfect removal of the ad container, but noticeably cleaner than a grid of broken image icons.

Pointing the Router at It

The last step was changing the DNS server in my router’s DHCP settings:

Primary DNS:   192.168.1.16   ← AdGuard Home
Secondary DNS: 1.1.1.1        ← fallback

From that point, every device that connects to the WiFi gets its DNS queries filtered automatically. No browser extension to install, no settings to change per device. A quick check of AdGuard Home’s query log showed phones and laptops showing up as clients within minutes of reconnecting.

After the first day, it blocked around 132 queries out of 2,290 — roughly a 5.8% block rate. That number climbs as more devices are active and more sites are visited.

What I Would Do Differently

The one thing I underestimated was how invisible the setup would be once it was working. DNS blocking is silent by nature — you don’t see it working, you just notice that certain things stopped loading. The query log in AdGuard Home’s dashboard is the best way to actually see what’s happening: which domains are being blocked, which devices are generating the most ad traffic, and occasionally catch a domain that probably should not have been blocked.

For anyone running a home server already, adding AdGuard Home is low effort with a noticeable payoff. The hardest part of the whole setup was freeing up port 53.