Merge pull request #1232 from 213edu/master

[Translated] 20140620 ENCRYPT DNS TRAFFIC IN LINUX WITH DNSCRYPT (VIA OPENDNS).md
This commit is contained in:
Xingyu.Wang 2014-06-21 21:44:37 +08:00
commit a181cf8ab4
2 changed files with 69 additions and 71 deletions

View File

@ -1,71 +0,0 @@
[Tranlation] in progress -- [213edu][https://github.com/213edu]
ENCRYPT DNS TRAFFIC IN LINUX WITH DNSCRYPT (VIA OPENDNS)
================================================================================
**DNSCrypt, as its name suggests, encrypts DNS traffic between your computer and OpenDNS, in the same way SSL turns HTTP traffic into HTTPS encrypted traffic.**
Initially, DNSCrypt was announced as being available for Mac only for now, but according to an OpenDNS [article][1] posted yesterday, the source code for DNSCrypt was published on GitHub when they've released the Mac preview and even though there's no user interface yet, Linux users can already install DNSCrypt.
### Why use DNSCrypt? ###
**DNSCrypt encrypts all DNS traffic between your computer and the OpenDNS servers (so you'll be using OpenDNS) and can protect you from man-in-the-middle attacks, spying, resolver impersonation, can prevent Internet service providers from blocking various websites and more.**
This is the first tool that encrypts DNS traffic - for instance, TOR encrypts DNS requests, but they are decrypted at the exit node.
> It doesnt require any changes to domain names or how they work, it simply provides a method for securely encrypting communication between our customers and our DNS servers in our data centers.
You can read more about DNSCrypt @ [OpenSND DNSCrypt][2] page and on [GitHub][3].
### How to use DNSCrypt in Linux ###
[Download DNSCrypt][4], install it and then run the following command in a terminal:
sudo /usr/sbin/dnscrypt-proxy --daemonize
![](http://4.bp.blogspot.com/-WLefdXHIzwg/Tz45kGKAZdI/AAAAAAAAH0k/KLBnWJom6-g/s1600/edit-network.png)
Then set your DNS server to "127.0.0.1" - to do this under GNOME, go to your Network Connections and select "Edit" and enter "127.0.0.1" under "DNS servers". If you are using DHCP, just select "Automatic (DHCP) addresses only, so you can enter a DNS server. Then, restart your network connection.
You can then check if you're using OpenDNS by visiting [THIS][5] link.
To get DNSCrypt to start automatically, you must create an init script. For Ubuntu, see below.
**Arch Linux users can install DNSCrypt-proxy via [AUR][6]** (it includes an rc.d script).
### DNSCrypt in Ubuntu ###
To make DNSCrypt start automatically in Ubuntu, I've created an Upstart script which you can use if you want - [download it][7].
Update: Because in Ubuntu 12.04 there is a local DNS cache running on 127.0.0.1 (dnsmasq), I've updated the script to make DNSCrypt use 127.0.0.2, so you should add "**127.0.0.2**" as your DNS and not "127.0.0.1" if you're using this script (for any Ubuntu version). Thanks to zzecool for testing it in Ubuntu 12.04!
To install the script, use the commands below (firstly extract the downloaded archive):
sudo cp dnscrypt.conf /etc/init/
sudo ln -s /lib/init/upstart-job /etc/init.d/dnscrypt
And finally, start it with:
sudo start dnscrypt
DNSCrypt should now start automatically when you boot. To stop it, you can use:
sudo stop dnscrypt
[Download DNSCrypt][8] (.deb, .rpm and source code available)
--------------------------------------------------------------------------------
via: http://www.webupd8.org/2012/02/encrypt-dns-traffic-in-linux-with.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://blog.opendns.com/2012/02/16/tales-from-the-dnscrypt-linux-rising/
[2]:http://www.opendns.com/technology/dnscrypt/
[3]:https://github.com/opendns/dnscrypt-proxy
[4]:http://download.dnscrypt.org/dnscrypt-proxy/
[5]:http://www.opendns.com/welcome
[6]:http://aur.archlinux.org/packages.php?ID=54702
[7]:http://webupd8.googlecode.com/files/dnscrypt-0.2.tar.gz
[8]:https://github.com/opendns/dnscrypt-proxy/downloads

View File

@ -0,0 +1,69 @@
使用DNSCrypt来加密您与OpenDNS之间的通信
================================================================================
**正如SSL能将HTTP通信变为加密过的HTTPS通信DNSCrypt, 物如其名, 是一款能加密您电脑与OpenDNS之间的通信的小神器。**
DNSCrypt刚问世的时候官方公布为是一款只有Mac才能用的工具但根据最近一片由OpenDNS发的[文章][1]表明虽然还没有用户界面但其实当Mac版DNSCrypt推出的时候源码已经放到了Github上了 Linux的用户也可以安装以及使用哦
### 为神马要使用 DNSCrypt? ###
**DNSCrypt可以加密您电脑与OpenDNS服务器的所有通信加密可以防止中间人攻击信息窥觑DNS劫持。更能防止网络供应商对某些网站的封锁。**
这是世界上第一款加密DNS通信的工具虽然TOR可以加密DNS的请求但毕竟它们只是在出口节点加密而已。
> 这款工具并不需要对域名或其工作方式做任何的改变它只是提供了个该工具的用户与机房里的DNS服务器之间的加密方式而已。
您可以在[GitHub][3]的[OpenSND DNSCrypt][2]页面阅读更多的相关信息。
### 如何在Linux使用DNSCrypt ###
首先下载安装[Download DNSCrypt][4] 然后在Terminal里输入这个命令:
sudo /usr/sbin/dnscrypt-proxy --daemonize
![](http://4.bp.blogspot.com/-WLefdXHIzwg/Tz45kGKAZdI/AAAAAAAAH0k/KLBnWJom6-g/s1600/edit-network.png)
然后把您的DNS服务器调成"127.0.0.1" - 在GNOME界面下的话只要到Network Connections网络连接选项然后选择"Edit"并在"DNS servers"输入"127.0.0.1"就好了。如果您用的是DHCP的话请选择Automatic (DHCP) addresses only" 这样的话才会进入DNS服务器。然后只要重连便可。
您可以访问这条[链接][5]来测试您连接到了OpenDNS了没。
如果您想设置开机启动DNSCrypt可以自建一个init的脚本如果您用的是Ubuntu可以参考下面的。
**Arch Linux的用户可以通过[AUR][6]来安装DNSCrypt-proxy** 内含rc.d脚本
### Ubuntu下的DNSCrypt ###
如果您想在Ubuntu设置开机启动您可以使用这个[Upstart脚本][7]。
注: 在Ubuntu 12.04版在127.0.0.1有个本地的DNS cache dnsmasq在跑所以已经把改脚本改成让DNSCrypt使用127.0.0.2了, 所以按照上面的教程应该把127.0.0.1换成127.0.0.2了。
要安装此脚本请使用以下的指令(要首先解压下下来的压缩文件):
sudo cp dnscrypt.conf /etc/init/
sudo ln -s /lib/init/upstart-job /etc/init.d/dnscrypt
然后用这个指令来启动:
sudo start dnscrypt
现在DNSCrypt就应该是开机自启了如果您想停止的话可以使用
sudo stop dnscrypt
[下载DNSCrypt][8] (.deb, .rpm以及源码都可供下载哦)
--------------------------------------------------------------------------------
via: http://www.webupd8.org/2012/02/encrypt-dns-traffic-in-linux-with.html
译者:[213edu](https://github.com/213edu) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://blog.opendns.com/2012/02/16/tales-from-the-dnscrypt-linux-rising/
[2]:http://www.opendns.com/technology/dnscrypt/
[3]:https://github.com/opendns/dnscrypt-proxy
[4]:http://download.dnscrypt.org/dnscrypt-proxy/
[5]:http://www.opendns.com/welcome
[6]:http://aur.archlinux.org/packages.php?ID=54702
[7]:http://webupd8.googlecode.com/files/dnscrypt-0.2.tar.gz
[8]:https://github.com/opendns/dnscrypt-proxy/downloads