Installing AdGuard Home on a NAS to remove ads throughout the house: blocking 60,000 calls a month, TV startup in 3 seconds

The TV at home had ads fifteen seconds after turning on. Last year, I used domain interception methods to fix it once, and most of it was better than half of the time, with only a tail left. Last month, my wife pointed at a splash screen ad on her phone and asked me if I could get this thing. The root of both problems is actually the same — advertising domains must go through DNS resolution. This time, I didn't patch the router; instead, I installed AdGuard Home in the NAS's Docker, pointing the DNS of all the family devices. After a month, it blocked 68,000 queries. I'll post the account later.
Let me start with the harsh facts: DNS blocking isn't invincible
.Before I started, I looked up quite a few tutorials online, and nine out of ten hyped it up as a whole-house ad, 'Extinction Master.' If you set it up as expected, you'd be cursed. First, let's talk about the boundary I measured over the past month.
Clean blocking: TV startup ads, domain resolution fails, ad programs can't load, so they skip directly. My TV boots from fifteen seconds to about three seconds—this is the most direct gain; Third-party ads and statistical tracking on web pages are basically completely eliminated; Some video app placements can even block the loading domain name.
Unstoppable: the splash screens of big tech apps like Douyin and Taobao. Their ads use HTTPDNS—apps directly ask their own servers for IP addresses via HTTPS without going through the DNS issued by your home. No matter how hard you block them on the NAS, it won't see it. So don't expect the phone to disappear completely after installation; that part depends on the phone's system tracking limits and disabling personalized recommendations.
Another type is the ad images built into the app's content, where the image and the main text come from the same server, making the domain name inseparable. This DNS layer is unsolvable. Expectations are placed on TV, web, and tracking—the experience is a surprise; Expecting to put all app splash screens on the app leads to disappointment. Understand this before taking action, and your mindset will be much steadier.
Installed in half an hour: Docker only has four parameters
.My N100 mini PC runs really fast, and Docker already has several containers for the downloader and video library, so I just added one more. The process for installing it is the same as Before Docker introductory setup, installing other containers was no different; there were only four things to really pay attention to:
| in the | configuration options | |
|---|---|---|
| Image: | adguard/adguardhome | official image, latest version is fine |
| Port | 3000, plus 53 TCP and UDP | 3000 is for initial installation and background management, 53 is the DNS main body. Both protocols need to be mapped |
| Mount | conf and work, both directories | , are configured outside the container. When the container is deleted and rebuilt, the rules and accounts are still restarted |
| policy | always | It crashed, the whole family couldn't get online, and the NAS had to get back up on its own after rebooting |
One more thing about ports: port mapping is NAS on the left and container on the right. Just copy the 3000 directly. 53. Remember to send one TCP and one UDP each, DNS queries go UDP, but TCP is also useful. Missing one can cause some scenarios to be flawed. The principle behind mounting a directory is the same as Upgrading a container is the same as copying parameters before upgrading a container; it's set outside the container and can be deleted at will.
After installing the browser, enter the NAS IP plus port 3000, enter the installation wizard to set up an administrator account, and confirm the DNS monitoring port is 53 to start working. Here's a prerequisite pitfall: the NAS's own port 53 must not be occupied. SSH goes in and types a line of SS -ulnp | grep :53. No damage is a relief. My Feiniu is empty, and Synology usually doesn't take up any of them; If it gets occupied, either stop using the service or switch to an unconventional port like 5335. But that way, the router issues DNS and writes a complicated way. If you can get back 53, get it back.
By the way, why is a NAS suitable for this job: it runs all year round, has a fixed address on the internal network, and comes with Docker. If you don't have a NAS, you can install a bypass router > an old laptop or
Just installing it well can only block foreigners: the Chinese rule set is the soul
. Actually, I was lazy at first and directly changed the router's DNS to AdGuard's public server 94.140.14.14, which works, but the rules can't be customized, statistics can't be seen, and the domain names with TV startup ads can't be blocked. That's when I started thinking about building my own place. Self-built buildings can't avoid the same problem: rules.
Don't rush to use it after installation. The default checkmark for AdGuard DNS Filter is an official general rule, effective for English ads, but sparsely overlaid for Chinese ads. The day before, I started using it without adding any rules, and a startup ad on the TV didn't stop me. I thought it was installed incorrectly.
For Chinese environments, anti-AD is widely recognized in the community as having the highest hit rate in Chinese. The path is the backend 'Filter →DNS Blocklist →Add Custom Subscriptions'. Enter the address https://anti-ad.net/adguard.txt, but be sure to use the adguard.txt version—don't casually fill in the easylist version, as the format is incorrect and you won't be able to parse it. I'm keeping the official default list so both sides don't conflict.
Take note of these two details in a small notebook. First, the default update interval is 168 hours, only once a week. I changed it to 24 hours—ad domains need to be changed frequently, and outdated rules are useless. Second, rules aren't always better. I've been greedy—I stacked four or five checklists, and on the third day, my wife's bank app went blank, and a rule treated the bank's domain name as an advertisement. They obediently returned the two lists, then went to the "Query Log" to find the bank's domain names and whitelist for release. From now on, whenever an app is trendy, follow this approach and don't rush to tear down the whole plan.
The most crucial step: Make sure all FamilyMart DNS points to NAS
. The containers running are just the store opening, and FamilyMart devices need to know where they're heading. The part to change is the router: go to the backend and change the DNS sent by DHCP to the NAS address. My home is 192.168.31.10. I fixed this address the printer with a static IP binding. The NAS must be fixed, otherwise if the address drifts, the whole family's DNS will be blind. Fill in 223.5.5.5 in the backup column, and explain why afterwards.
I've stepped into two pitfalls here. First, changing the router doesn't mean the device takes effect immediately—the DHCP lease hasn't expired, and the device still clings to the old DNS, so every device must forget about WiFi and reconnect once. How to verify: Connect your phone to WiFi, go to the details section and check the DNS section. Only if 31.10 appears does it count. Simply changing the router without checking this is basically a wasted change.
The second pitfall is the balance of backup DNS. If the NAS restarts or upgrades the system, the whole family's DNS will be empty for about ten minutes, with 223.5.5.5 still working, but the cost is that during this time, queries bypass blocking and ads leak in. I've weighed it—FamilyMart's ten minutes off the internet is much scarier than missing a few ads. You must fill out a backup. To minimize device leaks, NAS updates are postponed until midnight, when no one cares about ads.
If you choose the wrong interception mode, the TV actually boots up slower
.This setting is hidden, but it directly determines whether the TV boots up in three seconds or goes black for over ten seconds. In 'Settings→ General Settings', scroll down to find 'Intercept Mode', which defaults to 0.0.0.0.
0.0.0.0 is the default value. Most devices give up once they get it, but some apps foolishly treat it as a real address and connect. Before the connection timeout, they can wait for over ten seconds— I was stuck here last year when blocking TV startup ads. The ads disappeared, but the startup screen blacked out and was frustrating. You have to make domain resolution to 127.0.0.1 fail immediately to be satisfied. In AdGuard Home, this lesson is directly turned into graphical interface options.
So my method is: for interception mode, select 'Custom IPv4' and enter 127.0.0.1. When the ad domain is resolved to the loopback address, the device immediately fails in a row, not even a second long. Some people choose REFUSED, and just say 'reject' is quick, but some older devices handle this error code strangely. My TV can handle it, but your device is messy, so try customizing it first—it's safe. On the day the TV was renovated, it turned on much faster—this was the highlight of the entire plan.
Amonth's ledger and data reveal what
thehidden pleasure of installing it is the dashboard. After a full month of running, my family's accountant looks like this:
| Project | numbers explain: | |
|---|---|---|
| queries | are around 12,000 | yuan. TV, four phones, and tablets are the main targets |
| interception | rate is about 23,400 | items, with an interception rate of about 20%. |
| cumulative | 68,000 cases | doubled compared to the previous month, and the rules are well integrated |
| device most blocked | is the TV | startup ad domain that is viewed dozens of times a day |
Don't blindly believe one number: interception rate. More than half of the queries are Apple's regular heart rate and push notifications for live updates. Many of the blocked ads are tracked statistics, not ads you can see with the naked eye. Just take a 20% count and don't compare it to others. What's really worth checking every now and then is the "Top blocked domain names": the first place in my home is the domain from the TV startup batch, the second is a statistics SDK, indicating the rules are doing real work; If the number one site becomes a legitimate website domain, that's a false kill—add it to your whitelist immediately.
Here's the finishing order: install the container, add anti-AD Chinese rules, set router DNS to NAS, reconnect the device, change interception mode to 127.0.0.1. After five steps, half an hour will pass. Its essence is the same as understanding the steps of DNS resolution: if the domain can't leave, ads won't load. As for Douyin and Taobao's splash screen, my attitude is to go with the flow. That's the HTTPDNS battlefield, and DNS doesn't connect. The effort saved can be spent on personalized recommendations for apps—that's more practical than anything.
