Generate compand line used to run dnscrypt
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



This script can be used to select and configure a public dnscrypt resolver to work with dnscrypt as described in

Before you can use it you must install the requests and docopt packages:

pip install --user requests docopt

Finding a Suitable Resolver and Generating the Command

To find a suitable resolver, change to the directory that contains this script and run:


This accesses the list of resolvers from and then prints out a summary of the available resolvers. You should choose one. Say, for example, the OpenNIC server in Dallas, which has the name fvz-rec-us-dal-01:

./generate-dnscrypt-cmdline fvz-rec-us-dal-01

This produces a command line that can configures dnscrypt-proxy so that it talks to the chosen resolver.

This script contains some assumptions that you can change by editing the script. One is that the location of the dnscrypt-proxy executable. Another is that dnscrypt-proxy should listen on port 2053. A third is that you would like a PID file (a file that contains the process ID of the dnscrypt-proxy process) and that it should be placed in /tmp.

Configuring SystemD to run DNS Crypt

Often one uses systemd to automatically start dnscrypt-proxy. To do so, add the generated command line to the ExecStart field in /etc/systemd/system/dnscrypt.service). The file should end up looking something like this:

Description = DNScrypt
After =

ExecStart = /usr/local/sbin/dnscrypt-proxy
Restart = always
Type = forking
User = nobody
PIDfile = /tmp/

WantedBy =

After updating the dnscrypt.service file, you should run:

systemctl daemon-reload

You can start (or restart) your dnscrypt-proxy service using:

systemctl restart dnscrypt
systemctl status dnscrypt

Be sure the status messages include the message: 'This certificate looks valid'. If not, there may be a problem with the resolver you chose. You might try choosing another.