Go-HostGitHub ↗
The Problem
A lightweight DNS server written in Go — with domain blocking, allowlisting, per-client rate limiting, and query logging.
Key Decisions
- DNS Forwarding - Proxies queries to an upstream DNS server (defaults to 1.1.1.1:53)
- Domain Blocking — Blocks domains listed in blocked_domains with an NXDOMAIN response
- Domain Allowlisting — Explicitly permit domains via allow_domains, bypassing the blocklist
- Per-Client Rate Limiting — Caps each client IP at 10 requests per minute to prevent abuse
- Query Logging - Logs every query with its domain, client IP, and resolution status (Success, Blocked, Rate Limited)
- Zero Dependencies - Pure Go standard library, no heavy frameworks
Challenges
Implementing DNS-over-TCP and graceful shutdown while handling UDP/TCP concurrency.
Outcome
Built a type-safe, concurrent DNS server in Go with features like domain filtering, rate limiting, and logging.