Skip to content

dem0ns/DNSLogger

Repository files navigation

DNSLogger

Self-built DNS relay station for security testing. Supports domain interception, custom A-record rules, web dashboard, and real-time log streaming.

Running

Quick Start

go build -o dnslogger .
./dnslogger

Open http://127.0.0.1:8053 to access the dashboard.

DNS-over-HTTPS (DoH)

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.bin

To 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.

License

MIT

Star History

Star History Chart

About

DNS relay tool for security test.

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors