Create zRam a Memory Compression on Arch Linux

Install DNSCrypt on OpenWrt for Beginners

DNSCrypt is a tool for securing communications between a client and a DNS resolver using elliptic-curve cryptography in the same way the SSL turns HTTP web traffic into HTTPS encrypted Web traffic.

With DNSCrypt it can preventing spying, spoofing, and man-in-the-middle attacks from cyber criminals or even bypass DNS censorship from ISP using DNSLeak.
Warning: This tutorial was tested on OpenWrt Attitude Adjustment (12.09).


Router minimum size requirement = (256.00 KB)


Step 1 : Install DNSCrypt
  1. Open OpenWrt's LuCI Web's Interface
  2. Select tabs System - Software
  3. Click Update List
  4. In download and install packages type "dnscrypt-proxy" then click ok
[su_accordion] [su_spoiler title="For x86 Platforms"] For x86 Platforms (New Method)
cd /tmp
opkg install dnscrypt-proxy*.ipk
rm -f dnscrypt-proxy*ipk
For x86 Platforms (Old Method)
mkdir -p /etc/ssl/certs/
wget -P /etc/ssl/certs/
cd /tmp
curl -OL --cacert /etc/ssl/certs/cacert.pem
opkg install libsodium_0.4.5-1_x86.ipk
rm -f libsodium*.ipk
cd /tmp
curl -OL --cacert /etc/ssl/certs/cacert.pem
opkg install dnscrypt-proxy_1.4.0-1_x86.ipk
rm -f dnscrypt-proxy*.ipk
[/su_spoiler] [su_spoiler title="If dnscrypt-proxt doesn't exist on available packages for ar71xx or change the architecture to yours"]
cd /tmp
opkg install dnscrypt-proxy_*.ipk
rm -f dnscrypt-proxy*.ipk
[/su_spoiler] [/su_accordion]

Step 2 : Now the dnscrypt-proxy already installed you can check by doing following command or view on the software list on the router web interface
opkg status | grep -n "dnscrypt-proxy"
The command will show
  • 217:Package: dnscrypt-proxy
  • 224: /etc/config/dnscrypt-proxy 7524801bccfc5504202a7c469f9fbc51
If command doesn't show you anything maybe there is a problem with the installation of dnscrypt-proxy


Step 3 : Configure the dnscrypt to working properly First time you're need to start dnscrypt-proxy first
  1. Connect your router via web interface
  2. Select tabs System - Startup
  3. Find in initscript - dnscrypt-proxy
  4. Click enabled and start
Step 4 : After that we need to configure Openwrt to send DNS request to dnscrypt address ( or ( for x86 Platform
  1. Select Tabs Network - DHCP and DNS
  2. Select General Setting tabs - select DNS Forwardings Fill the both column with and /
  3. Select Resolv and Hosts File - Check the Ignore Resolve file (Optional)
  4. Press Save & Apply
Step 5 : Now restart dnsmasq or router 
  1. Select Tabs System - Startup
  2. Find in initscript - dnsmasq
  3. Click Restart
You're finished the steps!


To test if dnscrypt working properly on router - Run the following commands in SSH
logread | grep -n "using nameserver"
logread | grep "Proxying from"
The command will show
  • 132:Jan  1 01:01:00 openwrt dnsmasq[1883]: using nameserver for domain
  • 133:Jan  1 01:01:00 openwrt dnsmasq[1883]: using nameserver
  • Jul 1 12:00:00 openwrt dnscrypt-proxy[1831]: Proxying from to
To test if dnscrypt working properly on client
- In Windows 
  1. Open Command Prompt ( CMD )
  2. Do following commands
  3. nslookup
  4. set type=txt
- In Linux
  1. Open Terminal
  2. Do Following commands
  3. dig txt
the output is "dnscrypt enabled (7165343751484877)"


Update Notes

  • (15, June 2014) OpenWrt has been added "dnscrypt-proxy" packages into default packages (Attitude Adjustment 12.09 and higher)
  • (27, June 2014) Added x86 Platform and old versions installation steps (Thanks to locusf on Reddit)