Skip to content
AdminKit

Point an OpenWrt router at AdminKit Protective DNS

AdminKit's adminkit-dns OpenWrt package configures dnsmasq to forward LAN DNS to AdminKit's planned L1 Protective DNS resolvers and publishes a metadata-only snapshot of per-device connection and block activity, with device IDs hashed rather than raw MAC addresses. It is real, tested code, but its public repository isn't published yet — ask us for early access.

By AdminKit team, Netbase JSC · Updated

What this package does

adminkit-dns is an OpenWrt package, not a standalone resolver — it configures dnsmasq (already a dependency of OpenWrt’s base network setup) and exposes a adminkit-dns-sync shell script with four subcommands:

  • adminkit-dns-sync render-dnsmasq SITE_SLUG DOH_URL RESOLVER_IP [RESOLVER_IP ...] writes a dnsmasq upstream stanza (no-resolv plus server=<ip> lines) pointing LAN DNS at the configured resolver IPs, with a comment carrying the AdminKit DoH URL for routers or proxies that support DNS-over-HTTPS directly.
  • adminkit-dns-sync render-metadata SITE_SLUG LEASES_FILE EVENTS_FILE reads dnsmasq’s DHCP lease file and a local block-event log, and emits per-device connection/block counts for the trailing 24 hours plus the most recently blocked domain.
  • adminkit-dns-sync sync reads /etc/config/adminkit-dns via uci, writes both the dnsmasq conf and the metadata file, and reloads dnsmasq.
  • adminkit-dns-sync sync-loop calls sync on a loop, every poll_interval seconds — this is what /etc/init.d/adminkit-dns (a procd service, disabled by default) runs when option enabled '1' is set.

Everything here is POSIX sh, BusyBox-ash compatible, with no third-party code and no network library — it depends only on dnsmasq, plus the sha256sum and awk applets BusyBox ships by default.

The privacy design: hashed device IDs, no raw MAC or payload

render-metadata’s device_id field is sha256(site_slug + ":" + mac) truncated to 16 hex characters — not the raw MAC address or IP. The metadata it produces is a small JSON object of per-device connection/block counts and the most recently blocked domain; it never includes DNS query payload or a raw per-query client IP. This mirrors the same metadata-only design used by the Home Assistant add-on, which this package is the router-side counterpart to — useful if your router doesn’t run Home Assistant OS or doesn’t support DNS-over-HTTPS natively.

What’s buildable vs. what’s actually live

The package’s own test suite builds, lints and runs its generated config and metadata logic correctly (there is no OpenWrt SDK/buildroot in that test environment, so make package/adminkit-dns/compile itself has not been exercised against a real router). What is not available yet, beyond the repository access covered below, is AdminKit’s real L1 Protective DNS resolver: the example configuration below uses RFC 5737 TEST-NET-3 addresses (203.0.113.10, 203.0.113.11) as explicit placeholders, because AdminKit has not published real resolver IPs. Once you have access, set this package up to have the plumbing ready; don’t expect it to actually filter malicious DNS until AdminKit’s resolvers ship.

Build

Not published yet. The package’s source isn’t publicly available today, so the build steps below aren’t runnable yet. Ask us for early access and we will share what you need.

Available at release. Not yet published to an OpenWrt feed either, so build against an OpenWrt SDK/buildroot:

# from an OpenWrt buildroot checkout
cp -r adminkit-dns package/network/services/adminkit-dns
make package/adminkit-dns/compile

Configure (/etc/config/adminkit-dns)

config adminkit-dns 'main'
	option enabled '0'
	option api_url 'https://api.adminkit.net'
	option api_key ''
	option site_slug 'home'
	list resolver '203.0.113.10'   # placeholder (RFC 5737 TEST-NET-3) — set AdminKit's real resolver IPs
	list resolver '203.0.113.11'
	option poll_interval '300'
	option leases_path '/tmp/dhcp.leases'
	option events_path '/tmp/adminkit/events.tsv'
	option dnsmasq_conf_path '/etc/dnsmasq.d/adminkit.conf'
	option metadata_path '/tmp/adminkit/metadata.json'

Set option enabled '1' once you have real resolver IPs to point at, then let /etc/init.d/adminkit-dns start the sync-loop. events_path expects a TSV log of <epoch_ts>\t<mac>\t<qname>\t<action> lines (action is blocked or allowed); the package does not generate this log itself yet, and render-metadata works correctly with an empty or missing file, reporting zero connections in the meantime.

Try it without a router

Because render-dnsmasq and render-metadata are pure functions of their arguments, once you have the repository you can run them directly against fixture files on any POSIX shell:

Available at release.

# writes a dnsmasq upstream stanza to stdout
adminkit-dns-sync render-dnsmasq home \
  https://dns.adminkit.net/dns-query/site/home 203.0.113.10 203.0.113.11

# writes metadata JSON built from fixture lease/event files
adminkit-dns-sync render-metadata home \
  example-dhcp.leases \
  example-events.tsv

This is exactly how the package’s own test suite validates it without a real OpenWrt buildroot or device.

Where AdminKit fits

This package is the OpenWrt half of AdminKit’s planned Protective DNS product (L1) — a managed resolver blocking malware and C2 domains per device, deployed by changing your router’s DNS. It is in early access and not live yet; once you have access to this package, it lets small offices and technical home users running OpenWrt prepare the router side ahead of general availability. See our small office solutions page for the fuller picture of what’s free versus planned.

Once your router is actually forwarding LAN DNS to AdminKit’s resolvers, AdminKit’s DNS resolver test tool is the way to confirm your devices are genuinely using them rather than a resolver leaking around the new configuration — the same check applies whether the resolver change came from this package or from manually editing dnsmasq.conf. This guide is part of AdminKit’s DNS cluster of DNS guides and tools.

This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.

Frequently asked questions

Is this package in an OpenWrt feed I can opkg install?

Not yet, and it isn't buildable another way today either: building it against an OpenWrt SDK/buildroot needs the package's source, which isn't public yet. Ask us for early access at /contact/.

Does device_id expose my devices' MAC addresses?

No. device_id is sha256(site_slug + ":" + mac) truncated to 16 hex characters — a stable, non-reversible identifier, never the raw MAC address or IP.

Will this actually filter malicious DNS once I set it up?

The package renders correct dnsmasq config and metadata JSON in its own tests, but the resolver IPs you'd point it at (AdminKit's L1 Protective DNS) are not published yet — the example config uses RFC 5737 TEST-NET-3 placeholder addresses for exactly this reason. Treat this as the plumbing to have ready once you have access, not a working filter yet.

Where does the block-event log (events_path) come from?

The package does not generate it yet — render-metadata works correctly with an empty or missing events file, reporting zero connections. A future job would wire events_path to dnsmasq's query log or a blocklist hook.

What if I don't want to build against a real OpenWrt SDK?

The package's shell scripts (adminkit-dns-sync) have no uci or OpenWrt-specific dependency for their render-dnsmasq/render-metadata subcommands — you can exercise them directly with fixture lease/event files on any POSIX system with sha256sum and awk, which is exactly how the package's own tests validate it.

Want AdminKit to watch this for you?

Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.

Huy Nguyen (David), Founder and CEO of Netbase JSC

Talk to an expert

Huy Nguyen (David), Founder & CEO, Netbase JSC

Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.