Self-built DNS relay station for security testing. Supports domain interception, custom A-record rules, web dashboard, and real-time log streaming.
go build -o dnslogger .
./dnsloggerOpen http://127.0.0.1:8053 to access the dashboard.
The /dns-query endpoint (RFC 8484) is served on the HTTP port:
# GET
curl -s 'http://127.0.0.1:8053/dns-query?dns=AAABAAABAAAAAAAAB2V4YW1wbGUDY29tAAABAAE' -o resp.bin
# POST
curl -s -H 'content-type: application/dns-message' --data-binary @query.bin \
http://127.0.0.1:8053/dns-query -o resp.binTo expose it over HTTPS, put nginx (or Caddy) in front and terminate TLS there:
server {
listen 443 ssl http2;
server_name doh.example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location /dns-query {
proxy_pass http://127.0.0.1:8053;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
}
}Then point your DoH client at https://doh.example.com/dns-query.
