How to install DNSCrypt from source

Write tutorials 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

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 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 165 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 Jun 25, 2014 6:53 pm, edited 9 times in total.
Image
Tutorials | cynicaltux
Arch Linux i3wm, 64bit
User avatar
Previous1
Level 4
Level 4
 
Posts: 367
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?
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15449
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.
Image
Tutorials | cynicaltux
Arch Linux i3wm, 64bit
User avatar
Previous1
Level 4
Level 4
 
Posts: 367
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: 44
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

Image
Tutorials | cynicaltux
Arch Linux i3wm, 64bit
User avatar
Previous1
Level 4
Level 4
 
Posts: 367
Joined: Sun Dec 01, 2013 11:48 am

Re: How to install DNSCrypt from source

Postby stmcmurray on Wed May 28, 2014 11:29 am

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?
stmcmurray
Level 1
Level 1
 
Posts: 10
Joined: Sun Mar 30, 2014 6:13 pm

Re: How to install DNSCrypt from source

Postby Previous1 on Wed May 28, 2014 12:42 pm

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
Image
Tutorials | cynicaltux
Arch Linux i3wm, 64bit
User avatar
Previous1
Level 4
Level 4
 
Posts: 367
Joined: Sun Dec 01, 2013 11:48 am

Linux Mint is funded by ads and donations.
 

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 17 guests