brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: $important and $client make AdGuard Home rules win and apply to one device

Network and access
~/tips/tip-adguard-home-important-client-rules

||example.org^$important

Gives a custom AdGuard Home rule top priority, or limits it to specific devices on your network.

Custom filtering rules in AdGuard Home get interesting once a blocklist and an allowlist disagree, or when a rule should only hit one device. Two modifiers sort that out.

$important raises a rule above every rule without it, even above basic exception rules. The AdGuard docs give this pair:

||example.org^$important
@@||example.org^

The domain stays blocked, because the important rule beats the plain exception. If you want the exception to win, give it the modifier too: @@||example.org^$important.

$client limits a rule to certain clients: an IP address, a CIDR range or a client name. For example, block a game site for the kids’ tablets only:

||game.example^$client=192.168.1.0/24
||ads.example^$client=~192.168.1.20

The tilde excludes a client, so the second rule blocks for everyone except that one address. Names only work for persistent clients you added in AdGuard Home, so I’d use IP addresses unless the device has a fixed entry there.

Caveats. $client only works in AdGuard Home and AdGuard DNS, not in browser ad blockers that read the same lists. The docs say a rule with a modifier AdGuard does not know is ignored completely, so a typo fails silently. And these modifiers do not work on /etc/hosts-style lines. So I’d add one rule at a time and look at the query log to see whether it does what I meant.

Further reading: AdGuard DNS filtering rules syntax

Going deeper: Guide: AdGuard Home with Unbound: resolve DNS yourself instead of asking Cloudflare or your ISP

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link