How to install DNSCrypt from source

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
Previous1

How to install DNSCrypt from source

Post by Previous1 »

EDIT: This tutorial is outdated. Please follow the instructions here:

https://www.github.com/simonclausen/dns ... utoinstall


---
This one was quite moogle-intense (man+google!). The PPA might not work properly (from [url=http://forums.linuxmint.com/viewtopic.php?f=42&t=107096&start=20#p750499]this[/url] topic) or you might not want to use it. Compiling from scratch (bash script):

Code: Select all

#!/bin/bash

# Preparation
sudo apt-get install -y build-essential checkinstall
mkdir dnscrypt && cd dnscrypt
wget https://download.libsodium.org/libsodium/releases/libsodium-0.4.5.tar.gz
wget https://download.libsodium.org/libsodium/releases/libsodium-0.4.5.tar.gz.sig
gpg --recv-keys 1CDEA439 && gpg --verify libsodium-0.4.5.tar.gz.sig && tar -zxvf libsodium-0.4.5.tar.gz
wget http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.3.3.tar.gz
wget http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.3.3.tar.gz.sig
gpg --verify dnscrypt-proxy-1.3.3.tar.gz.sig && tar -zxvf dnscrypt-proxy-1.3.3.tar.gz

# Build NaCl
cd libsodium-0.4.5
./configure && make && sudo checkinstall --default make install && sudo rm *.deb
sudo ldconfig -v

# Build dnscrypt
cd ../dnscrypt-proxy-1.3.3
./configure && make && sudo checkinstall --default make install && sudo rm *.deb

# Disable dnsmasq
sudo sed -i 's/dns=dnsmasq/#dns=dnsmasq/' /etc/NetworkManager/NetworkManager.conf
sudo restart network-manager

# Add dnscrypt user
sudo adduser --system --quiet --shell /bin/false --group --disabled-password --disabled-login dnscrypt

# Run dnscrypt
sudo dnscrypt-proxy -d -u dnscrypt

# Run at boot (rc.local)
sudo sed -i -e '$i \/usr/local/sbin/dnscrypt-proxy -d -u dnscrypt\n' /etc/rc.local
Finally set your DNS to 127.0.0.1. Reboot if necessary.

If you use [url=http://forums.linuxmint.com/viewtopic.php?p=603578#p603578]xenopeek's scripts[/url] (for caching e.a) you have to change dnscrypt-proxy.conf

Code: Select all

exec /usr/sbin/dnscrypt-proxy --local-address=127.0.0.2
to

Code: Select all

exec /usr/local/sbin/dnscrypt-proxy -d -u dnscrypt -a 127.0.0.2
for the path, daemon and chroot, respectively.

Unpack the attached files
dns-config.tar.gz
and replace the section # (rc.local)

Code: Select all

# Run at boot (upstart)
sudo cp init/dnscrypt-proxy.conf /etc/init/
sudo cp init/dnsmasq.conf /etc/init/
sudo cp dnsmasq.conf /etc/
sudo cp init/ntpdate-dnsmasq.conf /etc/init/
Sticky for this thread? It's hard to find a complete dnscrypt guide.

Tested on:
Mint 13 XFCE (rc.local)
Mint 16 Cinnamon (rc.local)

Updates:
#1 Upstart job
#2 Added gpg check
Last edited by Previous1 on Wed Jun 25, 2014 6:53 pm, edited 9 times in total.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: How to install DNSCrypt from source

Post by xenopeek »

I've split your post from [url=http://forums.linuxmint.com/viewtopic.php?f=42&t=107096]the other topic[/url] as that one is now a collection of things that don't work and getting quite old. Made your topic a sticky. I'll give this a try later this week. Thanks for sharing! :D Perhaps you can complete your topic with (updated) parts of my topic that are relevant here, so users don't have to go back and forth to get all the information?
Image
Previous1

Re: How to install DNSCrypt from source

Post by Previous1 »

Thanks, I've updated the upstart info and will add an uninstall script later.
lisapisa2
Level 3
Level 3
Posts: 124
Joined: Thu Jan 30, 2014 11:36 am

Re: How to install DNSCrypt from source

Post by lisapisa2 »

This doesn't work. The site download.libsodium.org is gone. I tried for a day or so and it is extinct. This thread should be updated.
stmcmurray

Re: How to install DNSCrypt from source

Post by stmcmurray »

and replace the section # (rc.local)

Code: Select all
# Run at boot (upstart)
sudo cp init/dnscrypt-proxy.conf /etc/init/
sudo cp init/dnsmasq.conf /etc/init/
sudo cp dnsmasq.conf /etc/
sudo cp init/ntpdate-dnsmasq.conf /etc/init/
Hi there, I don't understand what you want me to do here.
"and replace the section # (rc.local)"-----what is the section #, and what is rc.local?

"# Run at boot (upstart)"----does this mean to run those commands everytime I boot, or put this script in startup folder, or what?

Thanks for your help

Edit- I think I got it. By copying those files to /etc/init/ it will start at boot. Correct?

Edit again- It doesn't seem to be working yet per http://www.opendns.com/welcome/. I must be doing something wrong. Any ideas?
Previous1

Re: How to install DNSCrypt from source

Post by Previous1 »

The first part of the tutorial is a script - copy the contents in a text file and mark it executable (right click, properties), and run it in a terminal.

The second part, upstart, is only if you use dns caching. What it says is to replace the last section (rc.local ...) of the above script.

By the way I should add this tutorial is outdated; a more current version with additional DNSCrypt providers can be found here:

https://github.com/simonclausen/dnscrypt-autoinstall
Post Reply

Return to “Tutorials”