- What Is This?
- Before You Start
- How It Works
- Installation Methods
- Step-by-Step Installation
- Configure Pi-hole
- Verify Everything Works
- Troubleshooting
- Common Questions
- Security Details
- Uninstall
DNS (Domain Name System) = The service that converts domain names (like google.com) into IP addresses (like 142.250.185.46) that your computer can understand.
Problem: Traditional DNS queries are sent in plain text - anyone on your network or your ISP can see which websites you visit.
Solution: This package encrypts your DNS queries using DNSCrypt and DNS-over-HTTPS, so nobody can see what websites you're visiting.
Your Device
↓
[DNSCrypt-proxy] ← Encrypts DNS queries
↓
Secure DNS Servers (no-log, DNSSEC-validated)
↓
[Pi-hole] ← Blocks ads/malware
↓
Your Device gets response
✅ Encrypted DNS - ISP can't see your browsing ✅ Ad Blocking - Combined with Pi-hole ✅ DNSSEC - Protection against DNS spoofing ✅ No-Log Servers - Selected servers that don't store your queries ✅ Automatic Failover - If one DNS server fails, switches to another
✅ Raspberry Pi running:
- Raspberry Pi OS 11 (bullseye) or newer
- 64-bit (arm64) OR 32-bit (armhf)
- At least 512 MB RAM
- At least 100 MB free disk space
✅ Pi-hole Already Installed
# Check if Pi-hole is installed
sudo systemctl status pihole-FTL
# Should show "active (running)"✅ Internet Connection
- Stable and working
- Can reach github.com
✅ SSH Access or terminal on the Pi
# Run this command to see your system type
dpkg --print-architectureOutput:
arm64= 64-bit (newer Raspberry Pi 4/5)armhf= 32-bit (older Raspberry Pi)amd64= PC/Intel (NOT supported by this package)
You'll tell Pi-hole to use this port for DNS queries.
What it does:
- Detects your system architecture (arm64 or armhf)
- Downloads the correct .deb package from GitHub
- Installs the .deb file
- Automatically starts the service
- Configuration already pre-set
When to use: If you're new to Linux - it does everything for you
# One command does it all
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/dnscrypt-proxy-pihole-install | bashWhat it does:
- Checks if dnscrypt-proxy is installed
- If NOT installed, installs it from Debian repositories
- Backs up original configuration
- Replaces config with Pi-hole optimized version
- Restarts the service
When to use: If you already have dnscrypt-proxy and want to reconfigure it
# Run this AFTER installing dnscrypt-proxy manually
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/dnscrypt-proxy-pihole.bash | bashWhat it does:
- Downloads the LATEST version from official Debian repositories
- Installs it (not pre-configured)
- You must configure it manually afterward
When to use: If you want vanilla dnscrypt-proxy (no pre-configuration)
# Advanced users only
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/install-latest-dnscrypt-proxy.bash | bashDo you have dnscrypt-proxy already installed?
├─ NO → Use script 1 or 3
│ ├─ Want it configured for Pi-hole automatically?
│ │ └─ YES → Script 1 (Recommended)
│ └─ Want to configure it yourself?
│ └─ YES → Script 3
│
└─ YES → Use script 2
└─ Reconfigure for Pi-hole
For most people. Installs and configures everything.
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/dnscrypt-proxy-pihole-install | bashWhat happens:
1. Script detects your system (arm64 or armhf)
2. Downloads correct .deb from GitHub
3. Installs with apt
4. Service automatically starts
5. Ready to configure in Pi-hole
Time: ~2 minutes
For users who want the most recent official version.
# Step 1: Install from Debian repositories
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/install-latest-dnscrypt-proxy.bash | bash
# Step 2: Configure for Pi-hole
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/dnscrypt-proxy-pihole.bash | bashWhat happens:
1. Downloads latest version from official Debian repos
2. Installs package
3. Second script configures it for Pi-hole
4. Service restarts with new config
Time: ~3 minutes
For maximum control. Download .deb manually.
# Download the .deb file for your architecture
# For 64-bit: dnscrypt-proxy-pihole_latest_arm64.deb
# For 32-bit: dnscrypt-proxy-pihole_latest_armhf.deb
# Then install
sudo apt install ~/dnscrypt-proxy-pihole_latest_arm64.deb
# Then run the configuration script
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/dnscrypt-proxy-pihole.bash | bash# SSH into your Pi (or use terminal if connected to screen/keyboard)
ssh pi@192.168.1.100 # Replace with your Pi's IP address# Copy and paste this entire command
curl -sSfL https://raw.githubusercontent.com/mapi68/dnscrypt-proxy-pihole/master/dnscrypt-proxy-pihole-install | bashExpected output:
[INFO] Detecting architecture...
[INFO] Downloading dnscrypt-proxy-pihole_latest_arm64.deb...
[INFO] Installing package...
[OK] Installation completed successfully
[INFO] Service is running on 127.0.0.1:53533
# Check if service is running
sudo systemctl status dnscrypt-proxy
# Expected output: "active (running)"# View recent logs
sudo journalctl -u dnscrypt-proxy -n 20 -f
# You should see messages about servers being loadedSee "Configure Pi-hole" below
Pi-hole needs to know: "Hey, use DNSCrypt-proxy for DNS instead of your default setup"
Open your browser and go to:
http://192.168.1.100/admin
(Replace 192.168.1.100 with your Pi's IP)
1. Click "Settings" (top right)
2. Click "DNS" (left menu)
3. Look for "Upstream DNS Servers"
Under "Upstream DNS Servers":
1. Check: Custom (3rd line)
2. In the input field, type: 127.0.0.1#53533
3. Click "Save"
Because DNSCrypt-proxy handles DNSSEC:
1. Look for "DNSSEC" section
2. UNCHECK the box "Validate DNSSEC"
3. Click "Save"
Your DNS settings should now show:
- Upstream DNS: 127.0.0.1#53533
- DNSSEC: Unchecked
Port 53 = Standard DNS port (what your devices normally use)
Port 53533 = Special port where DNSCrypt-proxy listens
Pi-hole queries this port, gets answers, gives to your devices on port 53
sudo systemctl status dnscrypt-proxyShould show:
● dnscrypt-proxy.service - DNSCrypt proxy
Loaded: loaded (/lib/systemd/system/dnscrypt-proxy.service; enabled)
Active: active (running) since Mon 2026-04-15 10:30:00 BST; 5min ago
sudo netstat -tlnp | grep 53533Should show:
tcp 0 0 127.0.0.1:53533 0.0.0.0:* LISTEN 1234/dnscrypt-proxy
In Pi-hole Admin:
1. Go to Settings → DNS
2. Should see "127.0.0.1#53533" listed
3. Should see recent queries from Pi-hole
# Test DNS resolution through dnscrypt-proxy
dig google.com @127.0.0.1 -p 53533Expected output:
; <<>> DiG 9.16.27-Debian <<>> google.com @127.0.0.1 -p 53533
; (1 server found)
;; Query time: 45 msec
;; WHEN: Mon Apr 15 10:35:00 BST 2026
;; MSG SIZE rcvd: 64
google.com. 299 IN A 142.250.185.46
What this means: ✅ DNS is working!
# Test a domain with valid DNSSEC signature
dig +dnssec google.com @127.0.0.1 -p 53533Expected output:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR
What this means: ✅ DNSSEC validation passed!
# Test a domain with bad DNSSEC signature
dig dnssec-failed.org @127.0.0.1 -p 53533Expected output:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL
What this means: ✅ DNSSEC is actively blocking bad signatures!
# View live DNS queries
sudo tail -f /var/log/dnscrypt-proxy/query.logExpected output:
[2026-04-15 10:35:00] google.com [A] -dnscrypt-relay-1
[2026-04-15 10:35:05] github.com [A] dnscrypt-relay-2
[2026-04-15 10:35:10] example.com [A] -dnscrypt
Columns:
- Timestamp = When query happened
- Domain = What was looked up
- Record type = A (IPv4), AAAA (IPv6), etc.
- Server = Which DNS server answered
Visit these websites to verify:
1. https://www.dnsleaktest.com
- Should NOT show your ISP's DNS servers
- Should show the servers dnscrypt-proxy uses
2. https://www.cloudflare.com/ssl/encrypted-sni
- Should show your DNS is encrypted
See the Troubleshooting section below.
Symptom:
sudo systemctl status dnscrypt-proxy
# Shows: "inactive (dead)"Solution:
# Step 1: Check the error message
sudo journalctl -u dnscrypt-proxy -n 50
# Look for error messages in output
# Step 2: Check if port 53533 is available
sudo netstat -tlnp | grep 53533
# If shows something, another app is using it
# Step 3: Restart the service
sudo systemctl restart dnscrypt-proxy
# Step 4: Check status again
sudo systemctl status dnscrypt-proxySymptom:
dig google.com @127.0.0.1 -p 53533
# Returns: connection refusedSolution:
# Step 1: Check if dnscrypt-proxy is listening
sudo netstat -tlnp | grep dnscrypt
# Should show something like:
# tcp 0 0 127.0.0.1:53533
# Step 2: If not listening, check configuration
cat /etc/dnscrypt-proxy/dnscrypt-proxy.toml | grep listen_addresses
# Should show:
# listen_addresses = ['127.0.0.1:53533']
# Step 3: If wrong, restore backup and reconfigure
sudo cp /etc/dnscrypt-proxy/dnscrypt-proxy.toml.bak \
/etc/dnscrypt-proxy/dnscrypt-proxy.toml
# Step 4: Restart
sudo systemctl restart dnscrypt-proxySymptom:
In Pi-hole, DNS queries still go to default servers
Solution:
# Step 1: Check Pi-hole settings via web interface
# Go to Settings → DNS
# Verify "127.0.0.1#53533" is listed
# Step 2: Restart Pi-hole
sudo systemctl restart pihole-FTL
# Step 3: Check if queries reach dnscrypt-proxy
sudo tail -f /var/log/dnscrypt-proxy/query.log
# Should see domains being queried
# Step 4: If not working, restart both services
sudo systemctl restart dnscrypt-proxy pihole-FTLSymptom:
Websites load slowly, DNS is slow
Solution:
# Step 1: Check CPU/Memory usage
top
# Is dnscrypt-proxy using lots of CPU?
# Step 2: Check logs for errors
sudo journalctl -u dnscrypt-proxy -n 100 | grep -i error
# Step 3: If no servers available
# This means all DNSCrypt servers are down (unlikely)
# Try temporarily using different bootstrap resolvers:
sudo nano /etc/dnscrypt-proxy/dnscrypt-proxy.toml
# Find: bootstrap_resolvers = ...
# Change to:
# bootstrap_resolvers = ['1.1.1.1:53', '8.8.8.8:53', '9.9.9.9:53']
# Step 4: Restart
sudo systemctl restart dnscrypt-proxySymptom:
Can't open http://192.168.1.100/admin
Solution:
# Step 1: Check Pi-hole is running
sudo systemctl status pihole-FTL
# Step 2: Check if web service is running
sudo systemctl status lighttpd
# Step 3: Check your IP address is correct
hostname -I
# Use this IP in browser instead
# Step 4: Check firewall
sudo ufw status
# May need to allow port 80 if using UFW
# Step 5: Restart everything
sudo systemctl restart pihole-FTL lighttpdA: No. If something goes wrong, you can always uninstall and go back to normal DNS in <5 minutes. See "Uninstall" section.
A: Two ways to encrypt DNS:
- DNSCrypt = Older, faster, works with more servers
- DNS-over-HTTPS (DoH) = Newer, uses HTTPS protocol, very secure
- This setup uses BOTH for maximum compatibility
A: Slightly, but you won't notice it:
- DNSCrypt adds ~50-100ms typically
- But Pi-hole's caching reduces queries overall
- With cached results: faster than before
A: Three signs:
- Port 53533 shows up in:
sudo netstat -tlnp | grep 53533 - Queries show up in logs:
sudo tail -f /var/log/dnscrypt-proxy/query.log - Your ISP can't see your DNS queries (check dnsleaktest.com)
A: Only Pi-hole is officially supported. Other services might work but not guaranteed.
A: Just uninstall (2 commands, see Uninstall section) and set Pi-hole back to default DNS. Takes <5 minutes.
A: This is pre-configured for Raspberry Pi + Pi-hole. Other devices need manual setup.
A: Yes:
- DNSCrypt encrypts queries so ISP can't see them
- No-log servers don't store your queries
- DNSSEC prevents DNS spoofing
- But you're trusting the DNS servers you use
A: It automatically selects from servers that have:
- ✅ DNSCrypt or DNS-over-HTTPS support
- ✅ No-logging policy (they promise not to store data)
- ✅ DNSSEC validation enabled
- ✅ Good uptime/speed
The configuration file has a list of ~300+ servers to choose from.
A: Just tell Pi-hole to use port 53533. That's it. Everything else is pre-configured optimally.
✅ Encrypted:
- DNS queries (which domains you visit)
- DNS responses (IP addresses returned)
- Connection between you and DNS server
❌ NOT Encrypted:
- Actual web traffic (use HTTPS for that)
- DNS server can still see queries (choose no-log servers)
DNSSEC = DNS Security Extensions
It prevents someone from:
- Spoofing DNS responses (faking IP addresses)
- Hijacking your requests (man-in-the-middle attacks)
How it works:
Your query → DNS server signs response with encryption key
→ Your device verifies the signature
→ If valid, you trust the answer
→ If invalid, query is rejected
With this setup:
- ✅ ISP can't see which websites you visit
- ✅ ISP can't see DNS queries
- ✅ Ad servers can't see your queries
⚠️ DNSCrypt server CAN see queries (choose no-log ones)⚠️ If you trust DNSCrypt provider (this setup uses trusted ones)
Without this setup (traditional DNS):
- ❌ ISP sees every website
- ❌ Could sell your browsing data
- ❌ Ad networks can track you
- ❌ Routers could be hacked to redirect DNS
# Remove the package and all configuration
sudo apt --purge autoremove dnscrypt-proxy-pihole -y1. Open Pi-hole admin interface
2. Go to Settings → DNS
3. In "Upstream DNS Servers", enable any standard server:
- 1.1.1.1 (Cloudflare)
- 8.8.8.8 (Google)
- Or any other you prefer
4. Click "Save"
# Should show command not found or similar
sudo systemctl status dnscrypt-proxy
# Port 53533 should be gone
sudo netstat -tlnp | grep 53533# Check status
sudo systemctl status dnscrypt-proxy
# View logs
sudo journalctl -u dnscrypt-proxy -f
# Restart service
sudo systemctl restart dnscrypt-proxy
# View configuration
cat /etc/dnscrypt-proxy/dnscrypt-proxy.toml
# Test DNS
dig google.com @127.0.0.1 -p 53533
# View live queries
sudo tail -f /var/log/dnscrypt-proxy/query.log
# Uninstall
sudo apt --purge autoremove dnscrypt-proxy-pihole -yConfiguration: /etc/dnscrypt-proxy/dnscrypt-proxy.toml
Backup: /etc/dnscrypt-proxy/dnscrypt-proxy.toml.bak
Logs: /var/log/dnscrypt-proxy/query.log
Service: /lib/systemd/system/dnscrypt-proxy.service
53533 = DNSCrypt-proxy listens here
53 = Pi-hole listens here (standard DNS)
- ✅ Encrypted your DNS queries
- ✅ Protected against DNS spoofing (DNSSEC)
- ✅ Hidden your browsing from ISP
- ✅ Combined with Pi-hole for ad blocking
- ✅ Set up automatic server failover
- Every time your device looks up a domain:
- Request goes to Pi-hole
- Pi-hole sends to DNSCrypt-proxy on port 53533
- DNSCrypt encrypts the query
- Sends to one of 300+ secure DNS servers
- Encrypted response comes back
- Pi-hole gives to your device
- ✅ Service auto-starts on reboot
- ✅ Logs rotate automatically
- ✅ No configuration needed going forward
- ✅ Updates available via apt
- Check logs first:
sudo journalctl -u dnscrypt-proxy -f - Verify with:
dig google.com @127.0.0.1 -p 53533 - Test online: https://www.dnsleaktest.com