Research Decisions
Date: 2026-02-16
Decision 1: Custom server over CoreDNS
Context: Need Go DNS server with SQLite zones and MCP management.
Options: CoreDNS (with custom SQLite plugin), build custom using `miekg/dns`.
Chosen: Custom server.
Rationale:
- Exact match to constraints (Go, SQLite, MCP-native).
- No reliance on unmaintained third‑party plugins.
- Single binary simplifies deployment and operations.
- Faster to MVP (2–3 weeks) than wrestling with CoreDNS plugin internals.
- Full control over features and code.
Alternatives: CoreDNS remains viable if we want its ecosystem later; see Report 3 on integration path.
---
Decision 2: MCP over stdio
Context: Choose IPC method for management interface.
Chosen: stdio (JSON‑RPC over stdin/stdout).
Rationale:
- Simplicity; no network port exposure.
- Fits MCP standard (stdio transport).
- Easy to spawn by AI agents; input/output captured directly.
- No authentication needed beyond OS process permissions.
---
Decision 3: In‑memory zone cache with SQLite persistence
Context: Balance query performance and durability.
Chosen: Load all zones into memory at startup/reload; writes go to SQLite first, then swap in‑memory structure.
Rationale:
- Sub‑microsecond query response.
- SQLite provides durability without a separate DB server.
- Reload via atomic swap ensures consistent snapshot.
- Simpler than per‑query DB reads or cache invalidation.
---
Decision 4: Systemd service under dedicated user
Context: Deployment and security.
Chosen: Run as `dnsmgr` user, systemd unit, binary at `/usr/local/bin/dns-server`, DB at `/var/db/dns-server.sqlite`.
Rationale:
- Principle of least privilege.
- Easy monitoring (`systemctl status`, journalctl).
- Standard Linux service management.