Take a look at <a href="https:&#x2F;&#x2F;github.com&#x2F;longsleep&#x2F;adblockrouter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;longsleep&#x2F;adblockrouter</a> - i hacked this together some months ago and use it since to provide DNS blacklisting to dnsmasq running on OpenWRT. If your OpenWRTC router has wget and ssl, it even runs directly on it.