Django-doh
Django-doh is a simple Django app to serve a DOH (DNS Over HTTPS) Proxy. It resolves DNS query on HTTP.
Quick start
- Install via pip:
pip install django-doh
- Add
'doh_server'to yourINSTALLED_APPSsetting like this:
INSTALLED_APPS = [
...
'doh_server',
]
- Include the
doh_serverURLconf in your project urls.py like this:
path('dns-query', include('doh_server.urls')),
- Add the conf in your settings like this:
DOH_SERVER = {
"RESOLVER": "internal",
# "RESOLVER": "8.8.8.8",
"AUTHORITY": "",
"LOGGER_LEVEL": "DEBUG",
}
To use the local resolver on the server where you run Django, use "internal".
Implementation
RFC 8484
Json implementation
Use with Firefox
in about:config edit:
network.trr.mode;3
network.trr.uri;https://127.0.0.1/dns-query
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;
proxy_pass http://127.0.0.1:8000/dns-query;
}
ssl_certificate /etc/nginx/cert.pem;
ssl_certificate_key /etc/nginx/key.pem;
}
}
Test suite
Run using tox.
tox --parallel
Benchmark
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
HTTP/1.1
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
Metadata
Release files for django-doh 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-doh-0.1.1.tar.gz | 9.7 kB | Without provenance | Details for django-doh-0.1.1.tar.gz |
Release files / django-doh-0.1.1.tar.gz
| Download URL | django-doh-0.1.1.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fc14c97fcdbd509faa2184c52abf2c953039c0741cd4ddf64bb88c943a10c54
|
|
BLAKE2b-256 checksum How to use checksums |
829150513c4b77dd3c25534fe062b53310a5f2498ac60d933fdf2a42a2b2e8b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Security for django-doh 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.