找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 35780|回复: 141

cdns 新发明的轮子,纯净DNS

  [复制链接]
发表于 2016-10-9 14:24 | 显示全部楼层 |阅读模式
本帖最后由 test0x01 于 2016-10-13 13:55 编辑

最近新发明了个轮子,自己使用觉得很好,所以分享出来。cdns 可以有效过滤器掉DNS投毒,不需要额外等待,所以你配置的上游的DNS有多快,它就有多快。
未进行大量有效性验证,如果对你无效(已知移动、广电线路可用),欢迎反馈,但请勿各种拍砖!之前使用dnscrypt-proxy,不是很稳定,有时候会出现一段时间DNS不工作的情况。我用了这个新轮子后还没有这种情况出现。

源码:https://github.com/semigodking/cdns

使用方法:
1. 下载编译,不多说。
2. 编辑配置文件。你可以直接从 https://github.com/semigodking/c ... config.json.example 复制出来。
    配置内容就一点点:
  1. {
  2.     "global": {
  3.     // run as daemon
  4.     "daemon": true,
  5.     // where to send log to: syslog:daemon, stderr, file:/path/file
  6.     "log": "syslog:daemon",
  7.     // pid file
  8.     //"pidfile": "/var/run/cdns.pid",
  9.     // enable or disable debug info
  10.     "log_debug": false
  11.     },
  12.     "cdns": {
  13.         // local server listen address and port
  14.         "listen_ip": "127.0.0.1",
  15.         "listen_port": 1053,
  16.         // Timeout for each DNS request
  17.         "timeout": 2,
  18.         // List of upstream DNS servers
  19.         // MUST be foreign DNS servers
  20.         "servers": [
  21.         {
  22.             "ip_port": "203.80.96.10"
  23.         },
  24.         {
  25.             "ip_port": "8.8.8.8:53"
  26.         }
  27.         ]
  28.     }
  29. }
复制代码
这两我这边可用:202.14.67.4  202.14.67.14

3. 运行
     ./cdns -c config.json
4. 检查log。如果log输出内容有下面这样的内容的话,就说明可以正常使用了。
  1. Sun Oct  9 13:13:20 2016 daemon.info cdns[6826]: Cool! DNS server 203.80.96.10:53 supports EDNS with UDP payload size: 4096
  2. Sun Oct  9 13:13:20 2016 daemon.info cdns[6826]: Cool! DNS server 8.8.8.8:53 supports EDNS with UDP payload size: 512
复制代码


其它说明:
1. 这不是一个普遍适用的工具。不同线路,配置不同上游DNS都会有不同结果。最重要的一条:你的线路至少要能把原DNS的正确响应结果送过来。
2. 这是一个不带缓存的DNS的转发工具,所以建议做为dnsmasq等DNS服务的上游服务器使用。
3. 原理: 给发出去的DNS请求加上一个EDNS option,只要目标DNS服务器支持 EDNS 的话,它也会带回这个option,而DNS抢答的似乎不会带这个option。主要靠这个option来判断。所以要求远端服务器支持EDNS才能正常工作。

请自行编译最新版吧,下面这些都没有更新。
编译好的:
BCM635x可用的:
x86 CentOS上编译的:
x86_64 Ubuntu 16.04 编译:
ramips HG255D及MTK7620系列可用:

其它编译好的目前提供不了了。

非常感谢ghostry!需要OpenWRT package的可以到这里去找。
https://github.com/ghostry/openwrt-gmod cdns和luci-app-cdns


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 10恩山币 +26 收起 理由
L*** + 1 支付宝已转500w给你!
ha*** + 5 亲,你这么厉害,我想做你的经纪人!
Hugo*** + 1 我来恩山就是为了看你!
zsh*** + 3 我来恩山就是为了看你!
乌*** + 5 一看就是觉得高端、大气、上档次!
未*** + 3 楼主威武—我就想问问挖掘机技术哪家强?
yumi*** + 3 亲,你这么厉害,我想做你的经纪人!
jo*** + 1 这么厉害的人结婚了吗?我要做你的经纪人!
梦*** + 1 亲,你这么厉害,我想做你的经纪人!
wgy*** + 3 亲,你太牛逼了,走,我请你吃鳇鱼头去~~~

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2016-10-9 14:33 | 显示全部楼层
具体什么用处
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 14:33 | 显示全部楼层
可惜没搭建编译平台!
好东西,谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-10-9 14:34 | 显示全部楼层

就是提供个纯净的 DNS 给 dnsmasq 之类的软件做上游服务器。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 19:26 | 显示全部楼层
有没有AR与 MTK 的编译好的,等我们也来测试下。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 19:44 | 显示全部楼层
本帖最后由 梦剧院 于 2016-10-9 20:37 编辑

想请教一下,如果我想在CentOS上最后一步make 出错了
make
[ 16%] Building C object CMakeFiles/cdns.dir/main.c.o
/root/cdns/main.c:29:26: error: event2/event.h: No such file or directory
/root/cdns/main.c:80: warning: ?.truct event_base?.declared inside parameter list
/root/cdns/main.c:132: warning: ?.truct event_base?.declared inside parameter list
/root/cdns/main.c:195: warning: ?.truct event_base?.declared inside parameter list
/root/cdns/main.c:195: error: conflicting types for ?.nit_signal_handlers?
/root/cdns/main.c:80: note: previous declaration of ?.nit_signal_handlers?.was here
/root/cdns/main.c: In function ?.nit_signal_handlers?.
/root/cdns/main.c:207: warning: assignment makes pointer from integer without a cast
/root/cdns/main.c:225: warning: assignment makes pointer from integer without a cast
/root/cdns/main.c: In function ?.tart_server?.
/root/cdns/main.c:258: warning: initialization makes pointer from integer without a cast
/root/cdns/main.c:265: warning: passing argument 1 of ?.nit_signal_handlers?.from incompatible pointer type
/root/cdns/main.c:195: note: expected ?.truct event_base *?.but argument is of type ?.truct event_base *?
/root/cdns/main.c:267: warning: passing argument 1 of ?.dns_init_server?.from incompatible pointer type
/root/cdns/main.c:132: note: expected ?.truct event_base *?.but argument is of type ?.truct event_base *?
make[2]: *** [CMakeFiles/cdns.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/cdns.dir/all] Error 2
make: *** [all] Error 2

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-10-9 19:46 来自手机 | 显示全部楼层
梦剧院 发表于 2016-10-9 19:26
有没有AR与 MTK 的编译好的,等我们也来测试下。

Ar 的我回头可以弄出来。ramips的也可试一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-10-9 19:48 来自手机 | 显示全部楼层
梦剧院 发表于 2016-10-9 19:44
想请教一下,如果我想在CentOS上编译,怎么下载呢?小白一名

git clone https://github.com/semigodking/cdns
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 20:06 | 显示全部楼层
不错。。......
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 21:16 | 显示全部楼层
Ubuntu1604编译了,没出错然后
./cdns -c ../config.json.example
什么也没有。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 21:20 来自手机 | 显示全部楼层
不错,试试看
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-10-9 21:20 来自手机 | 显示全部楼层
ghostry 发表于 2016-10-9 21:16
Ubuntu1604编译了,没出错然后
./cdns -c ../config.json.example
什么也没有。

应该已运行了  看系统log.  
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 22:40 | 显示全部楼层
大神,能否写一个OpenWrt的Makefile,方便直接集成到固件中编译.
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-10-9 22:58 来自手机 | 显示全部楼层
初识已是再见 发表于 2016-10-9 22:40
大神,能否写一个OpenWrt的Makefile,方便直接集成到固件中编译.

这个不是很熟,改天看看。先看看有没人用吧。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-10-9 22:59 | 显示全部楼层
有没有x86的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-25 22:37

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表