🌌

Koder DNS

Every Name Resolved

Authoritative and recursive DNS server with service discovery, zone management, DNS-over-HTTPS/TLS, and a powerful REST API.

Get Started View Source

Features

A complete DNS platform built from the ground up in Koder Lang, combining the best ideas from CoreDNS, PowerDNS, BIND9, and Consul DNS.

🔌

Authoritative DNS

Full support for A, AAAA, CNAME, MX, TXT, SRV, NS, SOA, PTR, and CAA records with BIND-format zone files.

🔍

Recursive Resolver

Walk the DNS hierarchy from root servers with QNAME minimization, LRU cache, stale serving, and prefetch.

🔒

DNS-over-HTTPS / TLS

RFC 8484 DoH with wire-format and JSON API. RFC 7858 DoT with TLS 1.2+ and persistent connections.

🔎

Service Discovery

Register services dynamically. Health-check-aware responses with TCP, HTTP, DNS, and script checks.

Weighted & Round-Robin

Load balance across multiple record values with configurable weights and round-robin selection.

🌐

Split-Horizon DNS

Serve different answers based on the client's source IP or network. Internal vs external views.

🚫

Blocklist Filtering

Block domains using hosts files, domain lists, AdBlock format, or regex patterns. Allowlist overrides.

Rate Limiting

Token bucket rate limiting per client IP with configurable burst, automatic banning, and exemptions.

🔃

Zone Transfers

AXFR and IXFR with change journal support. NOTIFY for primary/secondary replication.

📈

Query Analytics

Real-time query logging, top domains, top clients, QPS tracking, and per-type/rcode breakdown.

🔨

REST API

40+ endpoints for zone, record, service, filter, cache, and rate-limit management with API key auth.

📊

Prometheus Metrics

Export query counts, cache stats, latency, and zone metrics on the /metrics endpoint.

Quick Start

Get Koder DNS running in seconds with the CLI tool.

# Start the DNS server
$ kdns serve --config koder.toml

# Query a domain
$ kdns query example.com A
;; ANSWER SECTION:
example.com. 300 IN A 93.184.216.34

# Create a zone and add records
$ kdns zones create myzone.com
$ kdns records add --zone myzone.com --type A --name www 10.0.0.1

# Register a service for discovery
$ kdns services register --name web --address 10.0.0.1 --port 80

# View statistics
$ kdns stats
Koder DNS v1.0.0 Statistics
Uptime: 2h 15m 30s
Total queries: 152,847
Cache: 8,234/100,000 (94.2% hit rate)
14Record Types
40+API Endpoints
100KDefault Cache
4DNS Protocols

REST API

Full DNS management through a clean JSON API. Authenticate with an API key and manage everything programmatically.

# Create a zone
$ curl -X POST http://localhost:8553/api/v1/zones \
  -H "X-API-Key: kdns_your_key" \
  -d '{"name":"example.com"}'

# Add a record
$ curl -X POST http://localhost:8553/api/v1/zones/example.com/records \
  -H "X-API-Key: kdns_your_key" \
  -d '{"name":"www.example.com","type":"A","rdata":{"address":"10.0.0.1"}}'

# DNS-over-HTTPS query
$ curl "https://dns.koder.dev/dns-query?name=example.com&type=A" \
  -H "Accept: application/dns-json"