Okay, I finally figured out to get this to work. I purged my current installation and removed the ppa, because as solsTiCe mentioned, the package is broken. Than I grabbed this auto-install script from github. I compiled the package, however the configure script has a bug where it does not properly detect if systemd is present (even if you use the --with-systemd flag). To fix that, I opened the configure script and set the variable HAVE_SYSTEMD to TRUE manually. Than I reran configure, than make, and finally sudo make install.
Next, I created a directory, /etc/systemd/system/dnscrypt-proxy.service and placed these two scripts in that directory:
Update:This solution worked until I rebooted, but than the service did not start. I ended up using this script which now works flawlessly. Simclausen is my hero for writing this. Thanks to zenester for telling me the correct syntax:
/etc/systemd/system/dnscrypt-proxy.service/dnscrypt-proxy.service :
[Unit]
Description=DNSCrypt client proxy
Requires=dnscrypt-proxy.socket
[Install]
Also=dnscrypt-proxy.socket
WantedBy=multi-user.target
[Service]
Type=simple
NonBlocking=true
ExecStart=/usr/local/sbin/dnscrypt-proxy \
-R dnscrypt.eu-nl
Apparently this is not necessary:
And also
/etc/systemd/dnscrypt-proxy.service/dnscrypt-proxy.socket :
[Unit]
Description=dnscrypt-proxy listening socket
After=network.target
[Socket]
ListenStream=127.0.0.2:53
ListenDatagram=127.0.0.2:53
[Install]
WantedBy=sockets.target
Finally, I ran /usr/local/sbin/dnscrypt-proxy start -R dnscrypt.eu-nl
--local-address 127.0.0.2:53
The program started succesfully. To confirm that, I ran this command:
dig @127.0.0.2 debug.opendns.com txt
And everything looks good!
; <<>> DiG 9.9.5-9-Ubuntu <<>> @127.0.0.2 debug.opendns.com txt
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45692
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;debug.opendns.com. IN TXT
;; ANSWER SECTION:
debug.opendns.com. 0 IN TXT "server 3.otp"
debug.opendns.com. 0 IN TXT "flags 20 0 70 5950800000000000000"
debug.opendns.com. 0 IN TXT "originid 0"
debug.opendns.com. 0 IN TXT "actype 0"
debug.opendns.com. 0 IN TXT "source xxxxxxxxxx:35164"
debug.opendns.com. 0 IN TXT "dnscrypt enabled (xxxxxxxxxxxxxx)"
;; Query time: 154 msec
;; SERVER: 127.0.0.2#53(127.0.0.2)
;; WHEN: Fri May 22 17:24:32 EDT 2015
;; MSG SIZE rcvd: 248
Or to correctly register it as a service:
sudo systemctl enable dnscrypt-proxy.service
And than call it with sudo service dnscrypt-proxy start
I hope this helps someone.