How m13253/dns-over-https works
This repository provides a local DNS-over-HTTPS client and an HTTP-facing DoH server. The client accepts DNS queries, chooses a configured DoH upstream, and supports Google JSON and IETF wire-format exchanges; the server accepts DoH requests and forwards DNS queries to recursive DNS servers. The README documents configurable upstream selection, proxy deployment, and both protocols. The sampled excerpts show client dispatch and server DNS exchanges, but not all server routing or startup internals, so those connections are omitted where unverified.
Main entry points: client.go DNS listener · json-dns DNS JSON codec · google.go Google exchange · ietf.go IETF exchange
Components 15
DoH client
- Client startup
doh-client/main.go - Client config
doh-client/config/config.go - DNS listener
doh-client/client.go - Google exchange
doh-client/google.go - IETF exchange
doh-client/ietf.go
Upstream selection
- Selector strategies
doh-client/selector
DoH server
- Server startup
doh-server/main.go - Server config
doh-server/config.go - HTTP DNS server
doh-server/server.go - Google request format
doh-server/google.go - IETF request format
doh-server/ietf.go
DNS formats
- DNS JSON codec
json-dns
Other components
- DNS application
- DoH upstream
- Recursive DNS
Connections 16
- DNS application → DNS listener: sends DNS
Readme.md - Client startup → Client config: loads config
doh-client/main.go - Client startup → DNS listener: starts client
doh-client/main.go - DNS listener → Selector strategies: selects upstream
doh-client/client.go - DNS listener → Google exchange: dispatches JSON
doh-client/client.go - DNS listener → IETF exchange: dispatches wire
doh-client/client.go - Google exchange → DoH upstream: sends HTTP query
doh-client/google.go - IETF exchange → DoH upstream: sends HTTP query
doh-client/ietf.go - Google exchange → DNS JSON codec: decodes response
doh-client/google.go - IETF exchange → DNS JSON codec: uses DNS codec
doh-client/ietf.go - Server startup → Server config: loads config
doh-server/main.go - Server startup → HTTP DNS server: starts server
doh-server/main.go - HTTP DNS server → Recursive DNS: exchanges DNS
doh-server/server.go - HTTP DNS server → DNS JSON codec: uses IP checks
doh-server/server.go - IETF request format → DNS JSON codec: uses DNS helpers
doh-server/ietf.go - Google request format → DNS JSON codec: uses DNS helpers
doh-server/google.go