First of all, you must install the libsodium library.
You can download the lastest version from here.
Here are all the commands to install libsodium.
1 2 3 4 5 6 |
DiskStation> wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.3.tar.gz --no-check-certificate DiskStation> tar xzvf libsodium-1.0.3.tar.gz DiskStation> cd libsodium-1.0.3/ DiskStation> ./configure && make DiskStation> make install DiskStation> cp -a /usr/local/lib/libsodium* /lib/ |
Then you can download the DNSCrypt from here.
Here are all the commands to install DNSCrypt.
1 2 3 4 5 |
DiskStation> wget https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.6.0.tar.gz --no-check-certificate DiskStation> tar xzvf dnscrypt-proxy-1.6.0.tar.gz DiskStation> cd dnscrypt-proxy-1.6.0/ DiskStation> ./configure && make DiskStation> make install |
After installed these, you can run the following command to make a clean.
1 2 |
DiskStation> cd .. DiskStation> rm -rf libsodium* dnscrypt* |
And you can use the following command to test the DNS service with the Cisco OpenDNS.
1 2 3 4 5 6 7 8 9 10 11 |
DiskStation> /usr/local/sbin/dnscrypt-proxy -R "cisco" --test=0 [INFO] - [cisco] does not support DNS Security Extensions [INFO] - [cisco] does not support Namecoin domains [WARNING] - [cisco] logs your activity - a different provider might be better a choice if privacy is a concern [NOTICE] Starting dnscrypt-proxy 1.6.0 [INFO] Generating a new session key pair [INFO] Done [INFO] Server certificate #1435874751 received [INFO] This certificate looks valid [INFO] Chosen certificate #1435874751 is valid from [2015-07-03] to [2016-07-02] [INFO] Server key fingerprint is ED19:BFBA:FAFC:9257:DFDC:68C7:69BF:AC24:94CD:743F:3C1D:4966:134D:FE2C:4BDC:F315 |
If all goes well, you can run the following command to start DNSCrypt and set the DNS service.
1 2 |
DiskStation> /usr/local/sbin/dnscrypt-proxy -R "cisco" --daemonize DiskStation> echo 'nameserver 127.0.0.1' > /etc/resolv.conf |
Then you can visit http://www.opendns.com/welcome to make sure if you are using the Cisco OpenDNS service.
Finally you should add a script to rc.d to run DNSCrypt autostart whenever the Synology starts up.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
DiskStation> cd /usr/local/etc/rc.d DiskStation> cat dnscrypt-proxy.sh #!/bin/sh case "$1" in start) /usr/local/sbin/dnscrypt-proxy -R cisco --daemonize ;; stop) pkill dnscrypt-proxy ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 |