Article · 5 min read · Home lab
kubespin: One DNS for all your devices
Once Pi-hole is running, one switch points your servers, and every device on your mesh, at it. kubespin checks it answers from each server first, and each server falls back to its own DNS by itself if it ever stops.
Once Pi-hole is running, one switch points your servers, and every device on your mesh, at it. kubespin checks it answers from each server first, and each server falls back to its own DNS by itself if it ever stops.
Your DNS servers
When you install Pi-hole from Apps, it appears under DNS › DNS servers by itself. A server already running a DNS server of its own, such as AdGuard Home or Unbound, can be marked by hand: choose the server and what it runs, then Mark as a DNS server.
Pi-hole answers DNS on port 53. If the system’s own resolver holds port 53, the install page offers to turn off only its listener; kubespin checks the server still resolves names afterwards, and puts it back if not. On a server with a public address, close port 53 to the internet, or Pi-hole becomes an open resolver that others abuse. Its admin page stays private to the server. See kubespin: Apps for home.
Use it on your servers
- Go to DNS, then DNS servers, and choose Use on my servers beside your Pi-hole.
- kubespin asks the Pi-hole for a name from each server, then lists what would change on each, and which servers it leaves alone and why. Untick any server that should keep its own DNS, such as a VPS using its provider’s.
- Confirm. Each server is checked again before anything changes.
Which address each server uses:
- the Pi-hole’s mesh address, when both servers are on the kubespin: The mesh network;
- otherwise, the Pi-hole’s addresses on its own network;
- never its public address.
A server that can’t reach the Pi-hole is told why and what to do, for example “debian-laptop isn’t on the mesh: join it on the Mesh page, then it uses ionos-mini’s mesh address 100.64.0.2”.
What changes on a server:
- With systemd-resolved: a drop-in that puts the Pi-hole first, and keeps the server’s own DNS servers as the fallback.
- Without it:
/etc/resolv.confwith the Pi-hole first, and a copy of the original kept. - If names stop resolving straight after the switch, the server is put back at once.
- The Pi-hole’s own server is never pointed at itself, so it can’t loop.
Devices on the kubespin: The mesh network, including phones and laptops, use the Pi-hole’s mesh address wherever they are.
Servers using your DNS server lists each one, with the address it uses and what it falls back to.
If the Pi-hole stops answering
A timer on each server asks the Pi-hole every 5 minutes. After 3 failures in a row, the server goes back to its own DNS by itself, and kubespin tells you within 15 minutes, for example “debian-laptop went back to its own DNS”. The server’s row says Went back to its own DNS and why.
Undo
Stop using it on a server, or Stop on all, puts each server’s DNS back exactly as it was before.
Names for your devices
Optionally, the Pi-hole gets a local name for each of your servers, such as nas.home, from kubespin’s list of servers and their home network addresses. The names are kept up to date as servers change.
Blocking by name, not by port
Pi-hole blocks by name. It doesn’t close ports. For what each server leaves open, see its Firewall tab (kubespin: The server’s Firewall tab). Block lists can be set per group of devices, chosen by tag, for example “Kids’ devices: strict lists”.
To use it at home
To use the Pi-hole for every device in the house, set your router’s DNS to the Pi-hole’s server.
Command line
The kubespin command has no DNS commands yet. Use kubespin api, or a script with an API token:
kubespin api POST /network/dns/servers/$DNS_ID/preview
API
curl -s -X POST https://kubespin.io/api/v1/network/dns/servers/$DNS_ID/use \
-H "Authorization: Bearer $KUBESPIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"servers": {"'"$SERVER_ID"'": "100.64.0.2"}}'
servers maps each server to switch to the Pi-hole address the preview found for it. It returns results, one per server, with ok or the error.
GET /api/v1/network/dnslists your DNS servers and each server’s DNS.POST /api/v1/network/dns/serversmarks a server as a DNS server;DELETE /api/v1/network/dns/servers/{id}unmarks it.POST /api/v1/network/dns/servers/{id}/previewreturns what would change on each server.POST /api/v1/network/dns/stopwith{"server_ids": […]}puts servers back.
[!permissions] Permissions Area: Servers
Step Needs Default roles See your DNS servers and who uses them View Admin, Developer, Operator, Viewer Stop servers using it (Stop using it) Operate Admin, Operator Mark a DNS server, or switch servers to it Manage Admin API token: Read only to look; Read and change for the rest.