Change the router’s default DNS to the Raspberry Pi
Configure automatic restart on failure
Installation
1 2
sudo apt-get install dnscrypt-proxy sudo apt-get install dnsutils # includes commands like dig, it's better to install it
Configure dnscrypt-proxy
1 2 3
sudo nano /etc/dnscrypt-proxy/dnscrypt-proxy.toml listen_addresses = ['127.0.0.1:53', '192.168.0.150:53'] # change according to your own IP server_names = ['cloudflare','cloudflare-ipv6']
1
dnscrypt-proxy -resolve cloudflare-dns.com
Try if it works, only proceed to the next step if there are no issues.
Very important, otherwise the service startup will fail to bind the port
1 2 3
sudo nano /lib/systemd/system/dnscrypt-proxy.service # change dnscrypt-proxy service settings #User=_dnscrypt-proxy # comment out this line in the original file User=root # add this new line, let it run as root (seems not very safe.. lol, whatever)