Skip to content

Repository files navigation

pfSense DNSCrypt Proxy Package

CI Latest release Build provenance License: ISC

A pfSense package providing a full GUI for DNSCrypt Proxy, an encrypted DNS client supporting DNSCrypt v2, DNS-over-HTTPS (DoH), Oblivious DoH (ODoH), and Anonymized DNS protocols.

Note: This is a community-maintained package and is not affiliated with or supported by Netgate.

Features

  • Full GUI Configuration - 8 configuration tabs accessible from the pfSense web interface
  • Multiple Protocols - Supports DNSCrypt v2, DNS-over-HTTPS (DoH), Oblivious DoH (ODoH), and Anonymized DNS with relay routing
  • Popular Providers - Pre-configured servers from Cloudflare, Quad9, Google, AdGuard, NextDNS, Mullvad, OpenDNS, CleanBrowsing, and more
  • Custom Resolvers - Add custom servers via DNS stamps
  • Custom TOML Options - Add any dnscrypt-proxy option not exposed in the UI, including TOML section blocks, with validation via dnscrypt-proxy -check before saving
  • Domain Filtering - Block and allow lists, forwarding rules, and cloaking rules
  • Query Logging - Built-in query log viewer with filtering by domain, type, and client IP
  • Config Management - View, copy, download, import (paste or upload), and reset the TOML configuration
  • Advanced Tuning - Load balancing strategies, HTTP/3 (QUIC) support, ephemeral keys, cache size/TTL controls, and log rotation
  • Multi-Architecture - Supports both amd64 and arm64 (auto-detected)
  • Service Integration - Managed via Status > Services like native pfSense services

Screenshots

View screenshots

General Settings

General Settings

Server Selection

Server Selection

Cache & Filtering

Cache & Filtering

Logging

Logging

Lists

Lists

Advanced

Advanced

Query Log

Query Log

Config

Config

Installation

Run this command in the pfSense shell (via SSH or Console):

pfSense CE

pkg-static add -A https://github.com/nopoz/pfsense-dnscrypt-proxy/releases/latest/download/pfSense-pkg-dnscrypt-proxy.pkg

pfSense Plus

pkg-static -C /dev/null add -A https://github.com/nopoz/pfsense-dnscrypt-proxy/releases/latest/download/pfSense-pkg-dnscrypt-proxy.pkg

Installing a Specific Version

Replace latest/download/pfSense-pkg-dnscrypt-proxy.pkg with download/vX.X.X/pfSense-pkg-dnscrypt-proxy-X.X.X.pkg:

pkg-static add -A https://github.com/nopoz/pfsense-dnscrypt-proxy/releases/download/v1.0.0/pfSense-pkg-dnscrypt-proxy-1.0.0.pkg

See all available versions on the Releases page.

After installation, navigate to Services > DNSCrypt Proxy in the pfSense web interface.

Note: This package won't appear under "Installed Packages" since it's installed manually, not from the pfSense repository. It will appear under Services > DNSCrypt Proxy, on the Dashboard under Services Status, and under Status > Services.

Why -A? It marks the package automatically installed, which is not cosmetic here. pfSense's bulk package operations, Factory Defaults reset and "Reinstall all packages", loop over manually installed packages only and stop at the first one they cannot find in the pfSense repository. A package installed from a file is never in that repository, so without -A those operations abort partway and silently leave every package sorting after this one untouched. With -A they skip this package and finish normally. It does not risk the package being auto-removed, because the package also marks itself vital. If you installed without -A, run pkg set -A 1 pfSense-pkg-dnscrypt-proxy once.

Upgrading

To upgrade to a newer version, use the -f (force) flag:

pkg-static add -f -A https://github.com/nopoz/pfsense-dnscrypt-proxy/releases/latest/download/pfSense-pkg-dnscrypt-proxy.pkg

Or delete the existing package first, then install the new version:

pkg delete -f pfSense-pkg-dnscrypt-proxy
pkg-static add -A https://github.com/nopoz/pfsense-dnscrypt-proxy/releases/latest/download/pfSense-pkg-dnscrypt-proxy.pkg

Your configuration settings are preserved during upgrades.

Factory Defaults reset

A Factory Defaults reset will not remove this package. pfSense removes add-on packages by looping over manually installed ones, and this package marks itself automatic (see -A above) precisely so that loop skips it rather than stopping on it.

The package is left installed with its settings gone from config.xml, so it disappears from Services. The daemon will not start in that state, so nothing is left running, but the package files remain. Remove it explicitly if you want a clean box:

pkg delete -f pfSense-pkg-dnscrypt-proxy

Upgrading pfSense itself

Upgrading pfSense (2.8.1 to 2.9.0, for example) deletes every package that is not in the official pfSense repository. This is deliberate behaviour in Netgate's upgrade script and has been since 2017: any pfSense-pkg-* it cannot find in the remote repo is flagged automatic and collected by pkg autoremove.

From 1.2.10 the package marks itself vital, which makes pkg autoremove skip it, so it now survives. Reinstall the current release afterwards anyway. A major pfSense upgrade can change the FreeBSD base and the PHP version underneath the package (2.9.0 moves to FreeBSD 16 and PHP 8.5), and the flag only guarantees the files are still there, not that they still run.

If you are coming from a version before 1.2.10, or you restore a config backup onto a fresh install, the package will be gone and the symptom is that the firewall loses all DNS. The forward-addr: 127.0.0.1@5300 line in the DNS Resolver custom options belongs to Unbound, so it survives the upgrade and now points at a port with nothing listening. Unbound forwards every query into the void, including the firewall's own attempts to reach the package repository. To recover: remove the forward-zone block from Services > DNS Resolver > Custom options, apply, reinstall the package, then put the block back.

Configuration Guide

Basic Setup

  1. Install the package using the command above
  2. Navigate to Services > DNSCrypt Proxy
  3. Check Enable DNSCrypt Proxy
  4. Select your preferred DNS servers from the Server Selection tab
  5. Click Save

Option A: Use with DNS Resolver (Unbound) - Recommended

Forward Unbound queries through DNSCrypt Proxy:

  1. Go to Services > DNS Resolver > General Settings
  2. Add the following to Custom options:
server:
    do-not-query-localhost: no
forward-zone:
    name: "."
    forward-addr: 127.0.0.1@5300
  1. Click Save and Apply Changes

These lines belong to Unbound, not to this package, so they stay behind if the package is ever removed and will take the firewall's DNS down with them. See Upgrading pfSense itself.

Option B: Use as System DNS Directly

To use DNSCrypt Proxy directly via System > General Setup:

  1. Disable DNS Resolver: Go to Services > DNS Resolver, uncheck Enable, and click Save
  2. Configure DNSCrypt Proxy to listen on port 53
  3. Go to System > General Setup > DNS Server Settings and set DNS Server to 127.0.0.1

Note: The pfSense DNS Server Settings only accepts IP addresses and assumes port 53.

Uninstall

pkg delete -f pfSense-pkg-dnscrypt-proxy

The -f is required because the package marks itself vital so that a pfSense OS upgrade cannot delete it (see Upgrading pfSense itself). It only bypasses that check, so the uninstall is otherwise normal and still runs the package's own cleanup.

Use -f rather than clearing the vital flag by hand. pkg set -v 0 leaves the package marked automatic but no longer protected, and the next pkg autoremove will then delete it without warning.

Complete Removal (Troubleshooting)

If normal uninstall doesn't fully clean up, or you need a fresh start:

# From your local machine (requires SSH access to pfSense)
./uninstall.sh pfsense.local

This removes all package files, runtime artifacts, and pfSense registrations while preserving your settings in config.xml.

Building from Source

Requirements: FreeBSD with pkg tools, or a pfSense instance for remote builds.

# Clone the repository
git clone https://github.com/nopoz/pfsense-dnscrypt-proxy.git
cd pfsense-dnscrypt-proxy

# Build the package (requires FreeBSD)
./build.sh build

# Or build and deploy directly to pfSense via SSH
./build.sh deploy pfsense.local

# Clean build artifacts
./build.sh clean

Available Scripts

Script Purpose
build.sh build Build .pkg file (requires FreeBSD)
build.sh deploy [host] Build on pfSense via SSH and install
build.sh clean Remove local build artifacts
uninstall.sh [host] Completely remove package from pfSense

Environment Variables

Variable Default Description
DEPLOY_HOST pf SSH hostname for pfSense
PORTVERSION 1.2.3 Package version to build

Related

Security

This package vendors a third-party binary, so the release pipeline is built to keep that supply chain auditable:

  • Upstream binaries are signature-verified (minisign, against the official DNSCrypt key) in CI before they are committed, and proposed via pull request rather than auto-merged.
  • Releases carry SLSA build provenance plus a SHA256SUMS file. Verify a download with gh attestation verify <pkg> --repo nopoz/pfsense-dnscrypt-proxy.
  • Workflows are hardened: Actions pinned to commit SHAs (kept current by Dependabot), least-privilege tokens, and CI static analysis with ShellCheck, php -l, actionlint, and zizmor.

See SECURITY.md for the full policy and how to report a vulnerability.

Support

  • Open a GitHub issue for bug reports, feature requests, or questions
  • Add a star on GitHub to support the project!

More of my projects

Other open-source tools I maintain that you might find useful:

  • Hosaka - Docker image update monitor with notifications and one-click updates.
  • Portrieve - back up, restore, and migrate Portainer stacks as plain Docker Compose files.

License

ISC License - See LICENSE for details.

About

pfSense package for DNSCrypt Proxy - encrypted DNS with full GUI support

Topics

Resources

Security policy

Stars

21 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages