A project made for hushing the leaky nature of standard DNS query usage. By using encryption, DNS Query Name Mimisation, DNSSEC, Anonymized-DNS and Pi-hole.
This repository contains guidance on how-to get HushDNS
up and running and the files related to doing so.
For an in depth detailed rundown of the ins and outs of the HushDNS
components and the background of the HushDNS project. Read the initial HushDNS blog post.
docker
have to be installeddocker-compose
as well- optionally a server away from your LAN, where
dnscrypt-server
can run. This heightens the anonymity and privacy level of the solution. As it will be harder to trace the origin of 'x' DNS query- You can run the
dnscrypt-server
on a box on your LAN though. It would work fine. However, not with the same level of privacy and anonymity. So you really should consider isolating it on an external host
- You can run the
The order of the below component installation guidelines is important
The dnscrypt-server packs unbound, a DNS recursive name-server, wrapped in the encrypted-dns-server
project. It's an easy to install, high-performant, zero maintenance way to run your own DNS recursive name-server in a secure and private way. Letting you control logging and so forth.
N.B. we need to install the
dnscrypt-server
first as it generates a so calledstamp
that we need to "give" to thednscrypt-proxy
instance. This stamp holds information and a unique signature that is needed to connect to thednscrypt-server
If you plan to use e.g. CloudFlare
or Scaleway
to be your encrypted DNS recursive name-server provider, you can skip installing the dnscrypt-server
. Instead jump to the Running dnscrypt-proxy section. Duly note that you will certainly NOT have a private setup. Encrypted yes, but your DNS queries will be in the hands of e.g. CloudFlare
or Scaleway
. Do you really want that?
As the dnscrypt-server
needs an init
container, and that is not supported by the Docker
engine, you'll have to do with a shell script.
- Download this bash script and ensure to update the placeholders (capital words, separated by an underscore) with actual useful values
- Change the port of the
dnscrypt-server
if you need to (already have 'x' service running on port 443). Change from port 443 to "your" port, in all the locations where it is specified - Make the file executable by executing:
sudo chmod +x ./THE_NAME_YOU_GAVE_THE_FILE
- Change the port of the
- Execute the file on the system that is to host the
dnscrypt-server
- Note down the output of the
init -N NAME_TO_GIVE_YOUR_DNSCRYPT_SERVER...
command as you need the info when configuringdnscrypt-proxy
- you can also get the input after the fact by executing
docker logs dnscrypt-server
- The output to copy is the generated
stamp
. You need this in order to connect to thednscrypt-server
via thednscrypt-proxy
... we will set the stamp when we install and configure thednscrypt-proxy
instance
- you can also get the input after the fact by executing
The dnscrypt-proxy
instance uses this container image. It acts as an encrypting intermediary DNS forwarder. Between a non-DoH/DoT/DNSCrypt supporting DNS recursive name-server (in the HushDNS
case, its Pi-hole
) and e.g. a dnscrypt-server
instance or a service like CloudFlare's
1.1.1.1 service.
- Download this docker-compose file (you'll be using your own
dnscrypt-server
) - Execute:
docker-compose --project-name dnscrypt-proxy -f ./PATH_TO_THE_DNSCRYPT_PROXY_DOCKER_COMPOSE_FILE up -d
- This will install
dnscrypt-proxy
. Name the compose "project" and container dnscrypt-proxy and detach from the container
- This will install
DNSCRYPT_LISTEN_PORT
: "5354": Self-explanatoryDNSCRYPT_SERVER_NAMES
: "['MY_SECRET_DNSCRYPT-SERVER']": The dnscrypt-server or DoH server thatdnscrypt-proxy
should connect to. The NAME_TO_GIVE_YOUR_DNSCRYPT_SERVER part of thednscrypt-server init
commandnetwork_mode
: "host": Needed so thatPi-hole
can reach thednscrypt-proxy
listening port
In order to setup Anonymized-DNS
we need to complete the following steps.
You don't necessarily have to use Anonymized-DNS
. But, if you don't it will be a bit easier to track your ... (see this explanation for more on why)
- Ensure that there is a sub-folder named
conf
in the folder of thednscrypt-proxy
docker-compose.yml
file- In this folder create a file named
dnscrypt-proxy.toml
- In this folder create a file named
- Use this dnscrypt-proxy.toml file as a template
- Change the value of
server_names
in theGlobal settings
section to the name you gave yourdnscrypt-server
or use e.g.CloudFlare
orScaleway
- Potentially change the
listen_addresses
to the port you want (in theGlobal section
) - Under the
Anonymized DNS
section change theroutes
array to contain one or moreAnonymized DNS
relay servers of your choice. Find available relay servers here. Make sure to change theserver_name
in theroutes
definition, to reflect the value of theserver_names
property in theGlobal section
- Change the value of
N.B. if you look at the
dnscrypt-proxy
docker-compose.yml
file you'll notice that there is avolumes
mapping. This volume mapping is what the above steps relate to
As you saw in the section above. Configuring dnscrypt-proxy
involves its dnscrypt-proxy.toml
file. This file comes into play again, now that we are to use the dnscrypt-proxy
instance together with the dnscrypt-server
you spun up earlier.
- Find the
[static]
section in the file - Change the server name part of
[static.'hush.dns']
to the server name you've used throughout thednscrypt-proxy.toml
file - Finally set the value of the
stamp
property to theDNSCrypt
stamp that thednscrypt-server
spit out when it was initialized
The ad blackhole system. Reduces your risk of being PLF (page load finger printed), blocks ads, and speeds up the load-time of websites.
- Download the Pi-hole docker-compose file
- Ensure to go through the template Pi-hole docker-compose file and change the necessary values accordingly
- Execute:
docker-compose --project-name pihole -f ./PATH_TO_THE_PIHOLE_DOCKER_COMPOSE_FILE up -d
- Execute:
docker logs pihole
to verify that the container started properly and that Pi-hole is running as it should
- is configured to use a
dnscrypt-proxy
instance, so that Pi-hole forwards DNS requests todnscrypt-proxy
, in order to secure the queries- That
dnscrypt-proxy
instance is/should be configured to listen on port5354
- That
- It is assumed that there is a
HAProxy
container, acting as a load-balancer, in front of thePi-hole
container. And thatHAProxy
instance have the Pi-hole backend as its default_backend