Skip to content

Instantly share code, notes, and snippets.

@uugr
Created January 21, 2017 19:39
Show Gist options
  • Save uugr/6d3833fd83f448cf583f7d667156dd20 to your computer and use it in GitHub Desktop.
Save uugr/6d3833fd83f448cf583f7d667156dd20 to your computer and use it in GitHub Desktop.
Arch Linux Multiple "dnscrypt-proxy" Instances
# Install dnscrypt-proxy and create a user $(dnscrypt_user) for dnscrypt-proxy $(useradd -r -d /var/dnscrypt -m -s /sbin/nologin dnscrypt)
# Put .service and .socket file to /etc/systemd/system
# Enable service file and Start service
# Multiple .sockets can be created on the same port with different IPs
[Unit]
Description=DNSCrypt client proxy
Documentation=man:dnscrypt-proxy(8)
Requires=dnscrypt-proxy@%I.socket
After=network.target
Before=nss-lookup.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
NonBlocking=true
# Edit the configuration file appropriately, or the service will not start.
# See https://dnscrypt.org for more information.
ExecStart=/usr/bin/dnscrypt-proxy --resolver-name=%I --user=$(dnscrypt_user)
[Unit]
Description=dnscrypt-proxy listening socket
[Socket]
ListenStream=127.0.0.1:53
ListenDatagram=127.0.0.1:53
[Install]
WantedBy=sockets.target
[Unit]
Description=dnscrypt-proxy listening socket
[Socket]
ListenStream=127.0.0.2:53
ListenDatagram=127.0.0.2:53
[Install]
WantedBy=sockets.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment