mullane.info

AdGuard's rate limit, and other DNS surprises

Undated · network

DNS in the house goes through AdGuard Home on the firewall, which filters ads and trackers and then asks Unbound, which validates and forwards upstream. After the VLAN cutover, a few things in that chain behaved differently than they had on the old flat network.

The most interesting was AdGuard’s rate limit. It’s 20 queries per second by default, which sounds per-client, and it isn’t: by default it counts per /24 subnet. On one flat network of household devices that never mattered. After the cutover, all of the IoT zones happened to fall inside one /24 and all of the server zones inside another, so each group of zones shared one budget of 20 queries a second. The agent looked at the per-second peaks in the query log, and the server range was peaking at exactly 20, which is the kind of round number that tells you something is being cut off. Excess queries are dropped without any error, so nothing complained; things were just occasionally slow. The limit now counts per host, at 50 a second.

The second was new names. When the agent added a DHCP reservation, the name didn’t resolve: Unbound registers those names only when it reloads, and until then the answer is “no such name”. AdGuard then caches that answer for a while, so even after Unbound knew the name, asking through AdGuard still said it didn’t exist. The sync tool reloads Unbound itself now, and when testing, the agent asks Unbound directly as well as AdGuard, since that’s the only way to tell which of the two is behind.

The third came with a rename. The Steam Machine started with a long, clumsy reservation name and was renamed to something short. AdGuard keeps one client entry per reservation, and refuses to add a client whose IP address another client still holds, so the sync tool, which added the new name before deleting the old one, collided with itself. It deletes first now (then updates, then adds). Even then, AdGuard went on answering the old name from its cache until the cache was cleared.

A small one to finish: AdGuard’s own web interface redirects plain HTTP to HTTPS on the firewall’s IP address, which of course doesn’t match the certificate. Using the proper name in the first place avoids it.

None of these were outages, exactly. Each one made DNS look a little unreliable, in a way that would have been very easy to blame on the Wi-Fi.