dnscrypt-wrapper - A server-side dnscrypt proxy.
This is dnscrypt wrapper (server-side dnscrypt proxy), which helps toadd dnscrypt support to any name resolver.
This software is modified fromdnscrypt-proxy.
Install libsodium and libevent 2.1.1+ first.
On Linux:
$ ldconfig # if you install libsodium from source
$ git clone git://github.com/cofyc/dnscrypt-wrapper.git
$ cd dnscrypt-wrapper
$ make configure
$ ./configure
$ make install
On FreeBSD:
$ pkg install dnscrypt-wrapper
On OpenBSD:
$ pkg_add -r gmake autoconf
$ pkg_add -r libevent
$ git clone git://github.com/cofyc/dnscrypt-wrapper.git
$ cd dnscrypt-wrapper
$ gmake LDFLAGS='-L/usr/local/lib/' CFLAGS=-I/usr/local/include/
On MacOS:
$ brew install dnscrypt-wrapper
In Docker:
See https://github.com/jedisct1/dnscrypt-server-docker.
$ dnscrypt-wrapper --gen-provider-keypair \
--provider-name=2.dnscrypt-cert.<yourdomain> --ext-address=<external server ip>
If your server doesn't store logs, add --nolog
and if it supports DNSSEC,add --dnssec
.
This will create two files in the current directory: public.key
andsecret.key
.
This is a long-term key pair that is never supposed to change unless thesecret key is compromised. Make sure that secret.key
is securelystored and backuped.
It will also print the stamp for dnscrypt-proxy version 2.x.
If you forgot to save your provider public key:
$ dnscrypt-wrapper --show-provider-publickey --provider-publickey-file <your-publickey-file>
This will print it out.
$ dnscrypt-wrapper --gen-crypt-keypair --crypt-secretkey-file=1.key
$ dnscrypt-wrapper --gen-cert-file --crypt-secretkey-file=1.key --provider-cert-file=1.cert \
--provider-publickey-file=public.key --provider-secretkey-file=secret.key
In this example, the time-limited secret key will be saved as 1.key
and its related certificate as 1.cert
in the current directory.
Time-limited secret keys and certificates can be updated at any timewithout requiring clients to update their configuration.
NOTE: By default, secret key expires in 1 day (24 hours) for safety. You canchange it by adding --cert-file-expire-days=<your-expected-expiraiton-days>
,but it's better to use short-term secret key and usekey-rotation mechanism.
$ dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:443 \
--provider-name=2.dnscrypt-cert.<yourdomain> \
--crypt-secretkey-file=1.key --provider-cert-file=1.cert
The provider name can be anything; it doesn't have to be within an existingdomain name. However, it has to start with 2.dnscrypt-cert.
, e.g.2.dnscrypt-cert.example.com
.
When the service is started with the --provider-cert-file
switch, theproxy will automatically serve the certificate as a TXT record when aquery for the provider name is received.
As an alternative, the TXT record can be served by a name server foran actual DNS zone you are authoritative for. In that scenario, the--provider-cert-file
option is not required, and instructions forUnbound and TinyDNS are displayed by the program when generating aprovider certificate.
You can get instructions later by running:
$ dnscrypt-wrapper --show-provider-publickey-dns-records
--provider-cert-file <path/to/your/provider_cert_file>
$ dnscrypt-proxy --local-address=127.0.0.1:55 --resolver-address=127.0.0.1:443 \
--provider-name=2.dnscrypt-cert.<yourdomain> \
--provider-key=<provider_public_key>
$ dig -p 55 google.com @127.0.0.1
<provider_public_key>
is public key generated by dnscrypt-wrapper --gen-provider-keypair
, which looks like 4298:5F65:C295:DFAE:2BFB:20AD:5C47:F565:78EB:2404:EF83:198C:85DB:68F1:3E33:E952
.
Optionally, add -d/--daemonize
flag to run as a daemon.
Run dnscrypt-wrapper -h
to view command line options.
By default, and with the exception of records used for thecertificates, only queries using the DNSCrypt protocol will beaccepted.
If you want to run a service only accessible using DNSCrypt, this iswhat you want.
If you want to run a service accessible both with and withoutDNSCrypt, what you usually want is to keep the standard DNS port forthe unauthenticated DNS service (53), and use a different port forDNSCrypt. You don't have to change anything for this either.
However, if you want to run both on the same port, maybe because onlyport 53 is reachable on your server, you can add the -U
(--unauthenticated
) switch to the command-line. This is notrecommended.
Time-limited keys are bound to expire.
dnscrypt-proxy
can check if the current key for a given server isnot going to expire soon:
$ dnscrypt-proxy --resolver-address=127.0.0.1:443 \
--provider-name=2.dnscrypt-cert.<yourdomain> \
--provider-key=<provider_public_key> \
--test=10080
The --test
option is followed by a "grace margin".
The command will immediately exit after verifying the certificate validity.
The exit code is 0
if a valid certificate can be used, 2
if no validcertificates can be used, 3
if a timeout occurred, and 4
if a currentlyvalid certificate is going to expire before the margin.
The margin is always specified in minutes.
This can be used in a cron tab to trigger an alert before a key isgoing to expire.
In order to switch to a fresh new key:
First, create a new time-limited key (do not change the provider key!) andits certificate:
$ dnscrypt-wrapper --gen-crypt-keypair --crypt-secretkey-file=2.key
$ dnscrypt-wrapper --gen-cert-file --crypt-secretkey-file=2.key --provider-cert-file=2.cert \
--provider-publickey-file=public.key --provider-secretkey-file=secret.key \
--cert-file-expire-days=1
Second, Tell new users to use the new certificate but still accept the oldkey until all clients have loaded the new certificate:
$ dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:443 \
--provider-name=2.dnscrypt-cert.<yourdomain> \
--crypt-secretkey-file=1.key,2.key --provider-cert-file=1.cert,2.cert
Note that both 1.key
and 2.key
have be specified, in order toaccept both the previous and the current key.
Third, Clients automatically check for new certificates every hour. So,after one hour, the old certificate can be refused, by leaving onlythe new one in the configuration:
$ dnscrypt-wrapper --resolver-address=8.8.8.8:53 --listen-address=0.0.0.0:443 \
--provider-name=2.dnscrypt-cert.<yourdomain> \
--crypt-secretkey-file=2.key --provider-cert-file=2.cert
Please note that on Linux systems (kernel >= 3.9), multiples instances ofdnscrypt-wrapper
can run at the same time. Therefore, in order toswitch to a new configuration, one can start a new daemon withoutkilling the previous instance, and only kill the previous instanceafter the new one started.
This also allows upgrades with zero downtime.
For servers willing to block specific domain names (ads, malware), the--blacklist-file
parameter can be added. That blacklist file acceptspatterns such as:
example.com
: blocks example.com
as well as www.example.com
*.example.com
: identical, just more explicit*example*
: blocks the example
substring no matter where it appearsads.*
: blocks the ads.
prefixPrefix and suffix lookups are fast and can scale to very large lists.
注:第三方文档可能未及时与最新版本同步,以 README.md 为准。
之前我介绍了为了科学访问互联网其中非常重要的一环 DnsCrypt_Proxy,这其实是客户端。dnscrypt-proxy 安装好后会自带提供一些国外的公开的dnscrypt-wrapper服务,所以dnscrypt的服务端就是 dnscrypt-wrapper 。dnscrypt提供了自主搭建dnscrypt-wrapper服务的程序以及教程。 我这里就来简要说一下 dnscrypt-wrap
dnscrypt-proxy 可当作是一个 DNS 代理服务器,用于提供 DNS 客户端和服务器之间的安全通讯。 DNSCrypt是一个确保客户与DNS服务器之间传输安全的工具,基于DNSCurve修改而来。 由于Domain Name System(DNS)设计上的缺陷,用户在浏览器里输入很多海外网址以后,如果遭遇MITM(Man in the Middle,中间人攻击)或者DNS污染,浏览器就
dnscrypt-proxy 是一个 DNS 代理,实现类似 DNS 缓存和操作系统解析器。
DNSCrypt OSX Client 是一个用来控制 dnscrypt-proxy 和修改 DNS 设置的图形界面程序,包含设置面板、菜单指示以及一些交互的脚本。
问题内容: 我刚开始在我的项目中使用带有Gradle构建工具的Jenkins for CI。 我发现使用Gradle和Jenkins建立了一个持续交付管道,我不明白为什么作者建议“始终使用包装器”的原因。(c)否。120张幻灯片。为什么这比直接参与Gradle更好? 问题答案: 如果使用Gradle包装器,则支持不同版本的Gradle会更容易,并且使其他人更容易开始您的项目。他们可以克隆您的项目,
问题内容: 对于基于多个Webview的移动应用程序(使用Cordova,PhoneGap,XCode构建的iOS应用程序),我创建了以下方法来检查是否存在元素。请提示以下片段是否有意义?因为基于传统显式等待的传统包装器功能无法可靠运行。 谢谢 问题答案: 按照您共享的代码块,我看不到任何附加值来检查 是否 通过 出现了element。该实现看起来像是纯开销。相反,如果你看看 Java文档 的Ex
在此处输入图像描述 我从字面上得到这个错误是我打开的所有项目,有谁能帮我修复这个?