Skip to main content

A simple Django app to serve DOH.

Project description


Django-doh is a simple Django app to serve a DOH (DNS Over HTTPS) Proxy. It resolves DNS query on HTTP.

Quick start

  1. Install via pip:
pip install django-doh
  1. Add 'doh_server' to your INSTALLED_APPS setting like this:
  1. Include the doh_server URLconf in your project like this:
path('dns-query', include('doh_server.urls')),
  1. Add the conf in your settings like this:
    "RESOLVER": "internal",
    # "RESOLVER": "",
    "AUTHORITY": "",

To use the local resolver on the server where you run Django, use "internal".


RFC 8484

Json implementation

Use with Firefox

in about:config edit:


For the URI, add your URI for your reverse proxy serving Django.

You can use Nginx as reverse proxy :

events {
http {
    server {
        listen 443 ssl http2 default_server;
        location /dns-query {
            proxy_set_header Host $host;
        ssl_certificate /etc/nginx/cert.pem;
        ssl_certificate_key /etc/nginx/key.pem;

Test suite

Run using tox.

tox --parallel


Macbook Pro 2019 Processor 2,4 GHz Intel Core i5 Memory 8 GB 2133 MHz LPDDR3

Server Django and a reverse proxy Nginx in a Docker container.

apib -c 100 -d 60 @benchmark_get_url.txt

Duration:             60.032 seconds
Attempted requests:   7911
Successful requests:  7911
Non-200 results:      0
Connections opened:   104
Socket errors:        0

Throughput:           131.780 requests/second
Average latency:      734.647 milliseconds
Minimum latency:      27.760 milliseconds
Maximum latency:      9819.022 milliseconds
Latency std. dev:     710.929 milliseconds
50% latency:          606.548 milliseconds
90% latency:          1360.734 milliseconds
98% latency:          2845.927 milliseconds
99% latency:          3612.085 milliseconds

Client CPU average:    0%
Client CPU max:        0%
Client memory usage:    0%

Total bytes sent:      1.15 megabytes
Total bytes received:  2.44 megabytes
Send bandwidth:        0.15 megabits / second
Receive bandwidth:     0.33 megabits / second

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-doh-0.1.1.tar.gz (9.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page