PrismDNS is a lightweight, high-performance authoritative DNS proxy written in Go. It acts as a DNS server that routes queries to different upstream DNS servers based on the domain being queried. This allows multiple DNS servers to share the same public IP address.
- Domain-based routing: Forward DNS queries to different upstream servers based on domain names
- Fallback routing: Configurable fallback server when no specific route matches
- Health checks: Automatic health monitoring of upstream servers every 5 seconds
- Rate limiting: Built-in rate limiting to prevent abuse (configurable per domain or globally)
- HTTP API: RESTful API for dynamic route management without restarting the server
Start PrismDNS with your routes:
./PrismDNS-linux-amd64 \
-route example.com,10.0.1.5 \
-route dept.example.com,10.0.2.8 \
-route api.internal,10.0.1.6 \
-fallback 10.0.1.7:1053 \
-http-api-key your-secret-api-keyFor a full list of flags, run ./PrismDNS-linux-amd64 -help
docker run -d \
-p 53:53/udp \
-p 53:53/tcp \
-p 8053:8053 \
truewinter/prismdns:{version} \
-route example.com,10.0.1.5 \
-route dept.example.com,10.0.2.8 \
-route api.internal,10.0.1.6 \
-fallback 10.0.1.7:1053 \
-http-api-key your-secret-api-keyImages are not published with the latest tag. Check the releases page for the latest version.
For a full list of flags, run docker run prismdns -help
All API requests require the X-Api-Key header (except for the apex /healthcheck and /metrics endpoints).
List all configured routes.
Response:
[
{"Domain":"example.com","Ip":"10.0.1.5","Port":53},
{"Domain":"api.internal","Ip":"10.0.2.8","Port":53}
]Add a new route.
Request:
{"Domain":"newdomain.com","Ip":"10.0.3.5","Port":53}Modify an existing route.
Request:
{"Ip":"example.com","Port":5300}Delete a route.
Get health status of all configured routes.
Response:
[
{
"Domain":"example.com",
"Ip": "10.0.1.5",
"Port": 53,
"Health": {
"Ok": true,
"Error": "",
"LastCheck": 1779670849,
"LastCheckLatency": 1.204
}
}
]Basic health check endpoint for the HTTP API (no authentication required).
Get health status of a specific route. See GET /healthcheck/routes.
Prometheus metrics endpoint (no authentication required). A pre-built Grafana dashboard is available for your convenience.
For troubleshooting, PrismDNS supports DNS CHAOS queries for version information:
# Returns the version
dig @10.0.53.53 CH TXT version.bind
# Returns the server ID set by the server-id flag
dig @10.0.53.53 CH TXT id.serverBuild the binaries for your platform:
./build.shThis compiles both Linux and Windows executables to the dist/ directory.
docker build -t truewinter/prismdns .