A minimal work-in-progress content filter system based on DNS similar to AdguardHome.
This project serves the purpose to learn more about the Domain Name System.
This workspace project consists of the following subcrates in crates
:
dns
- a library crate for constructing and consuming DNS packets (currently only supports DNS over UDP)dns-client
- a minimal DNS client that wrapsdns
to test resolvingA
andCNAME
records for a given domain name and optionally given upstream DNS server (default1.1.1.1
)dns-block
- a single-threaded DNS server that selectively proxies queries to1.1.1.1
or blocks blacklisted domains based on a listdns-block-threaded
- a multi-threaded version ofdns-block
dns-block-tokio
- an async version ofdns-block
based on Tokio (not fully async at this point, as it uses blocking parts ofdns
)
You can either clone and cargo install -p dns-block-tokio
and then run dns-block-tokio
or use Docker (only linux/amd64
images are being built by CI at the moment) by pulling the image
docker run -p 53000:53000 maximumstock2/dns-thingy:latest
which runs dns-block-tokio
inside the container on port 53000 and makes it available on your host machine
on port 53000
as well. Optionally, use -p 53:53000
to map your local port 53
to be used, but that most likely requires root privileges.
At that point dns-thingy
can answer DNS queries, ie. dig google.com @127.0.0.1 @53000
.
- feat: add custom blocking rules
- feat: cache records according to answer TTL
- feat: implement more record types
- api: request builder for DNS queries & responses
- bench
- every commit on
master
should trigger a benchmark suite that collects the typical benchmark data, posts the data to the repository/GH Pages and builds a website with the results in a graph
- every commit on
I'd like to use this opportunity to create a performance benchmark setup to get a better feeling for performance characteristics of different implementation strategies, such as:
- Single-threaded blocking (current implementation of
dns-block
) - Multi-threaded blocking
- Asynchronous based on Tokio
See Benchmarks for further information.