10

dnscrypt + dnsmasq

 3 years ago
source link: https://blog.lilydjwg.me/2012/11/10/dnscrypt-dnsmasq.36288.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

dnscrypt + dnsmasq

本文来自依云's Blog,转载请注明。

安装过程没什么特别的就不说了。

启动 dnscrypt-proxy。由于 systemd 实在太复杂,一时半会搞不明白,所以我直接手动启动了:

sudo dnscrypt-proxy --local-address=0.0.0.0:35535 --user=nobody --logfile=/var/log/dnscrypt.log --daemonize

然后测试下:

>>> dig -p 35535 twitter.com @localhost
; <<>> DiG 9.9.2 <<>> -p 35535 twitter.com @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65004
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 8192
;; QUESTION SECTION:
;twitter.com.                   IN      A
;; ANSWER SECTION:
twitter.com.            16      IN      A       199.59.148.82
twitter.com.            16      IN      A       199.59.149.230
twitter.com.            16      IN      A       199.59.150.39
;; Query time: 267 msec
;; SERVER: 127.0.0.1#35535(127.0.0.1)
;; WHEN: Sat Nov 10 15:07:01 2012
;; MSG SIZE  rcvd: 88

It works!

然后配置 dnsmasq。

server=127.0.0.1#35535
bogus-nxdomain=67.215.65.132

bogus-nxdomain那行是为 OpenDNS 加的,类似于国内 ISP 的「114 页面」。dnscrypt 默认使用 OpenDNS 的服务器,暂时不知道其它提供加密 DNS 的服务器地址,所以只好这样了。

然后重启 dnsmasq 就 OK 了。

说点题外话。其实很多服务进程启动起来很简单,比如 sshd,改好配置文件后直接运行就可以了。再比如 mongod 和 privoxy,手动启动还方便指定配置文件什么的。我的个人电脑不是服务器,不需要复杂的各种管理。虽然说不是服务器,但重启次数还是不需要和 Windows 比的。所以,systemd 给我带来了一堆麻烦,却没能解决我遇到的任何问题

发送到 Kindle


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK