How to install DNSCrypt from source

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

How to install DNSCrypt from source

Postby Previous1 on Wed Dec 11, 2013 12:18 am

This one was quite moogle-intense (man+google!). The PPA might not work properly (from this 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 xenopeek's scripts (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
(1.45 KiB) Downloaded 88 times

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 Dec 25, 2013 5:21 pm, edited 7 times in total.
User avatar
Previous1
Level 4
Level 4
 
Posts: 247
Joined: Sun Dec 01, 2013 11:48 am

Linux Mint is funded by ads and donations.
 

Re: How to install DNSCrypt from source

Postby xenopeek on Wed Dec 11, 2013 3:59 am

I've split your post from the other topic 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?
Forum Rules | IRC Channel Rules
Image
Arch Linux / 64-bit / Gnome Shell
User avatar
xenopeek
Level 21
Level 21
 
Posts: 13678
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How to install DNSCrypt from source

Postby Previous1 on Wed Dec 11, 2013 1:36 pm

Thanks, I've updated the upstart info and will add an uninstall script later.
User avatar
Previous1
Level 4
Level 4
 
Posts: 247
Joined: Sun Dec 01, 2013 11:48 am

Re: How to install DNSCrypt from source

Postby lisapisa2 on Sun Mar 30, 2014 2:16 pm

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.
lisapisa2
Level 1
Level 1
 
Posts: 33
Joined: Thu Jan 30, 2014 11:36 am

Re: How to install DNSCrypt from source

Postby Previous1 on Mon Mar 31, 2014 7:21 am

User avatar
Previous1
Level 4
Level 4
 
Posts: 247
Joined: Sun Dec 01, 2013 11:48 am


Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 12 guests