After reading this topic:
I’ve found a method to install DNSCrypt on the RPI using the latest dnsmasq version from the testing repositories (from Debian).
Keep in mind that this install method is no longer using the stable repositories from Jessie!
Another method to install the latest dnsmasq version is described here:
RPI – unattended upgrade (using Debian testing repositories):
Create an upgrade.sh file:
sudo nano upgrade.sh
And paste the following content:
vim upgrade.sh
Remove any third party sources
rm -rf /etc/apt/sources.list.d/*
Change the repo's
sed -i -e 's/jessie/testing/g' /etc/apt/sources.list
Update package lists
apt-get update
UPGRADE ALL THE THINGS!!!
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" dist-upgrade
Remove no longer needed packages
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" autoremove --purge
FINISH HIM
reboot
Start unattended upgrading to Testing with the following command:
sudo bash ./upgrade.sh
For future upgrade(s) use the sudo bash ./upgrade.sh each time!
Install the latest dnsmasq version:
sudo apt-get install -y dnsmasq
Version check:
dnsmasq -v
Dnsmasq version 2.76 Copyright (c) 2000-2016 Simon Kelley
Compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Before installing DNSCrypt you could install pi-hole (optional) with the following command:
curl -sSL https://install.pi-hole.net | bash
DNSCrypt on Pi-hole:
Follow these steps to install and enable DNSCrypt on your Pihole installation.
Read more about DNSCrypt here: https://dnscrypt.org/
Please note that your Pihole will stop working during the installation so keep that in mind if there are other users on your network using the Pihole.
At the time of writing the latest version dnscrypt-proxy is 1.9.4 but that may change, please edit the commands according to version.
Please note, I take no responsibility for any breakage or corruption of your Pihole installation when following this guide.
Install necessary system packages and reboot
sudo apt-get update
sudo apt-get -y install build-essential tcpdump dnsutils libsodium-dev
sudo apt-get -y install locate bash-completion
sudo reboot
Build DNSCrypt from the sources
mkdir -p dnsproxy
cd dnsproxy
wget http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.9.4.tar.gz
tar -xf dnscrypt-proxy-1.9.4.tar.gz
cd dnscrypt-proxy-1.9.4
sudo ldconfig
./configure
make
sudo make install
Configure the system
Starts DNSProxy in daemon mode automatically
sudo nano /etc/systemd/system/multi-user.target.wants/dnscrypt-proxy.service
sudo nano /etc/systemd/system/multi-user.target.wants/dnscrypt-proxy-backup.service (if adding a second resolver)
And paste this content:
[Unit]
Description=Secure connection between your computer and DNS resolver
After=network.target network-online.target
[Service]
Type=forking
Restart=always
RestartSec=5
PIDFile=/var/run/dnscrypt-proxy.pid
ExecStart=/usr/local/sbin/dnscrypt-proxy --daemonize
-a 127.0.0.2:40
-R dnscrypt.eu-nl
-E
--edns-payload-size=4096
-p /var/run/dnscrypt-proxy.pid
[Install]
WantedBy=multi-user.target
Change the -a flag to 127.0.0.3:40 and use a different resolver on the backup
You may choose anther resolver(s) from the following link:
https://github.com/jedisct1/dnscrypt-proxy/blob/master/dnscrypt-resolvers.csv
Note: The reason why we're assigning the IPs 127.0.0.2 and 127.0.0.3 is so that we can have a better overview in the Forward Destinations chart inside the dashboard.
Then reboot the RPI:
sudo reboot
Change DNS resolver in DNSMasq config
sudo nano /etc/dnsmasq.d/01-pihole.conf
Edit this section and point to dnscrypt-proxy
Add other name servers here, with domain specs if they are for
non-public domains.
server=127.0.0.2#40
server=127.0.0.3#40 (if adding a second resolver)
Reboot your Pihole:
sudo reboot
Change the setupvars.conf
Change the following variables to customize your dnscrypt proxy services:
sudo nano /etc/pihole/setupVars.conf
to
PIHOLE_DNS_1=127.0.0.2#40
PIHOLE_DNS_2=127.0.0.3#40
Reboot your Pihole:
sudo reboot
Test if DNSSec is working:
Test DNSSec from a command line interface:
Output dig comand:
102 ;; WE HAVE MATERIAL, WE NOW DO VALIDATION
103 ;; VERIFYING DS RRset for eu. with DNSKEY:61045: success
104 ;; OK We found DNSKEY (or more) to validate the RRset
105 ;; Ok, find a Trusted Key in the DNSKEY RRset: 61045
106 ;; Ok, find a Trusted Key in the DNSKEY RRset: 19036
107 ;; VERIFYING DNSKEY RRset for . with DNSKEY:19036: success
108
109 ;; Ok this DNSKEY is a Trusted Key, DNSSEC validation is ok: SUCCESS
110
Test if DNSCrypt is working:
sudo journalctl -u dnscrypt-proxy -f
sudo journalctl -u dnscrypt-proxy-backup -f (to test backup resolver)
Ouput:
-- Logs begin at Thu 2016-11-03 18:16:42 CET. --
Feb 05 09:44:21 raspberrypi dnscrypt-proxy[527]: Chosen certificate #808464433 is valid from [2016-09-08] to [2017-09-08]
Feb 05 09:44:21 raspberrypi dnscrypt-proxy[527]: The key rotation period for this server may exceed the recommended value. This is bad for forward secrecy.
Feb 05 09:44:21 raspberrypi dnscrypt-proxy[527]: Server key fingerprint is 72DF:BE14:531F:F2AD:FD0F:BC8B:F711:B93D:799F:E4D0:34EC:D26B:8BF9:FFA9:32E7:2B79
Feb 05 09:44:21 raspberrypi dnscrypt-proxy[527]: Proxying from 127.0.0.2:40 to 176.56.237.171:443
Feb 05 10:45:30 raspberrypi dnscrypt-proxy[527]: Refetching server certificates
Feb 05 10:45:30 raspberrypi dnscrypt-proxy[527]: Server certificate with serial '0001' received
Feb 05 10:45:30 raspberrypi dnscrypt-proxy[527]: This certificate is valid
Feb 05 10:45:30 raspberrypi dnscrypt-proxy[527]: Chosen certificate #808464433 is valid from [2016-09-08] to [2017-09-08]
Feb 05 10:45:30 raspberrypi dnscrypt-proxy[527]: The key rotation period for this server may exceed the recommended value. This is bad for forward secrecy.
Feb 05 10:45:30 raspberrypi dnscrypt-proxy[527]: Server key fingerprint is 72DF:BE14:531F:F2AD:FD0F:BC8B:F711:B93D:799F:E4D0:34EC:D26B:8BF9:FFA9:32E7:2B79
For further checks you can run:
sudo tail -f /var/log/syslog
Source - Raspberry Pi unattended upgrade Raspbian to Debian Testing:
https://raymii.org/s/blog/Raspberry_Pi_Raspbian_Unattended_Upgrade_Jessie_to_Testing.html