pexcn / openwrt-chinadns-ng Goto Github PK
View Code? Open in Web Editor NEWChinaDNS Next Generation for OpenWrt, refactoring with epoll and ipset.
Home Page: https://github.com/zfl9/chinadns-ng
License: GNU General Public License v3.0
ChinaDNS Next Generation for OpenWrt, refactoring with epoll and ipset.
Home Page: https://github.com/zfl9/chinadns-ng
License: GNU General Public License v3.0
openwrt-chinadns-ng/files/chinadns-ng.init
Line 135 in 68ba156
请教一个问题,目前我在 lean 的固件分支上编译了 k3 的 chinadns-ng,但是发现运行时会报错:
2020-11-22 14:28:18 ERR: [ipset_addr4_is_exists] received an error code from kernel: (-2) No such file or directory
2020-11-22 14:28:18 INF: [handle_remote_packet] reply [beacons.gcp.gvt2.com] from 127.0.0.1#6053, result: accept
2020-11-22 14:28:20 ERR: [dns_packet_check] this is a query packet, but header->qr != 0
2020-11-22 14:28:20 ERR: [dns_packet_check] this is a query packet, but header->qr != 0
2020-11-22 14:28:24 ERR: [dns_packet_check] this is a query packet, but header->qr != 0
好像是没有初始化对应 ipset list?
手动运行命令开启详细日志输出:
# /usr/bin/chinadns-ng -b 0.0.0.0 -l 5353 -c 127.0.0.1#6053 -t 127.0.0.1#7053 -g /etc/chinadns-ng/gfwlist.txt -m /etc/chinadns-ng/chinalist.txt -o 3 -p 3 -r -v
2020-11-22 14:17:59 INF: [main] local listen addr: 0.0.0.0#5353
2020-11-22 14:17:59 INF: [main] chinadns server#1: 127.0.0.1#6053
2020-11-22 14:17:59 INF: [main] trustdns server#1: 127.0.0.1#7053
2020-11-22 14:17:59 INF: [main] ipset ip4 setname: chnroute
2020-11-22 14:17:59 INF: [main] ipset ip6 setname: chnroute6
2020-11-22 14:17:59 INF: [main] dns query timeout: 3 seconds
2020-11-22 14:17:59 INF: [main] gfwlist entries count: 5728
2020-11-22 14:17:59 INF: [main] chnlist entries count: 72763
2020-11-22 14:17:59 INF: [main] gfwlist have higher priority
2020-11-22 14:17:59 INF: [main] enable repeat mode, times: 3
2020-11-22 14:17:59 INF: [main] filter reply without ip addr
2020-11-22 14:17:59 INF: [main] cur judgment mode: fast mode
2020-11-22 14:17:59 INF: [main] enable `SO_REUSEPORT` feature
2020-11-22 14:17:59 INF: [main] print the verbose running log
2020-11-22 14:17:59 ERR: [dns_packet_check] this is a query packet, but header->qr != 0
对应的 list 文件、chnroute 文件:
完整的配置:
config chinadns-ng
option bind_addr '0.0.0.0'
option bind_port '5353'
option ipset_name4 'chnroute'
option ipset_name6 'chnroute6'
option gfwlist_file '/etc/chinadns-ng/gfwlist.txt'
option chnlist_file '/etc/chinadns-ng/chinalist.txt'
option timeout_sec '3'
option chnlist_first '0'
option fair_mode '0'
option reuse_port '1'
option china_dns '127.0.0.1#6053'
option trust_dns '127.0.0.1#7053'
option repeat_times '3'
option noip_as_chnip '0'
option enable '1'
其中 china_dns
与 trust_dns
配置的是 smartdns 的分组,并且确认是可查询的:
rt
最近发现dns查询全走的代理,看了一下,周六自动更新的几个txt内容全部为:
root@OpenWrt:/etc/chinadns-ng# cat chnroute.txt
因为之前改了一下设置,没有代理openwrt本身,所以wget raw.github是可能无法正常更新的
OpenWrt-19.07.7
PKG_NAME:=chinadns-ng
PKG_VERSION:=1.0-beta.24
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zfl9/chinadns-ng.git
PKG_SOURCE_VERSION:=df3bb7c6310df9b3c0f874b7a0c38ea5ce0996cb
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=pexcn [email protected]
基于rampis编译的chinadns-ng,以及luci,可以直接取用。
chinadns-ng_1.0-beta.15-1_mipsel_24kc.ipk
luci-app-chinadnsng_1.0-3_mipsel_24kc.ipk
其中luci与平台无关,各个平台都可以直接用
编译是基于19.07.1的sdk但是没有用到什么特殊的功能,应该从15以后的版本都没问题。
源码放在sdk的package下面,分类在
Utilities-->luci-chinadns-ng
make package/luci-app-chinadnsng/{clean,compile} -j V=99
即可
链接: https://pan.baidu.com/s/10bJbc_I6pM50-fqDilkklg 提取码: hhkc
另外目前采用ucitrack的功能希望能够让程序根据config的更改自行reload没办法实现,不知道为什么所以目前就没有添加uci-default文件,而是采用了在luci页面apply的时候执行reload,同时会在日志记录reload的信息。希望作者可以把service-trigger有空看看。
搭配DoT的话,貌似是推荐用DNSSEC.
rt,如果有一个合并功能选择就完美了
还有一个问题是,将luci页面编译进去后,我并没有在openwrt页面里面找到相应的CHINADNS NG的LUCI
你好作者,编译这个应用会一起生成luci界面么?
rt
I can run chinadns-ng using command line, such as '/usr/bin/chinadns-ng -b xxx -l xxx'. But I failed to run '/etc/init.d/chinadns-ng start'
I tried to figure out what was wrong by viewing /etc/init.d/chinadns-ng. In function start_chinadns_ng(), the variable $enable is set to 0, the script exited because of this.
I have no idea why $enable is 0. I am sure that I enabled chinadns-ng before staring it.
Please take a look at this situation when you have time, thanks.
add ::/0
for ipv6?
Check:
openwrt-chinadns-ng/files/chinadns-ng.init
Lines 145 to 146 in 92fddbf
我的5300端口是ss-tunnel到8.8.4.4:53了。用dig通过5300查询,一直可以得到答复。
5353是chinadns的端口,用dig通过5353查询国内一直可以,查询国外有时就不行。
感觉唯一的区别就是chinadns一直用一个端口发请求,dig是随机端口。
是不是用同一个端口短时间查询太多次,就会得不到答复?
希望能直接在makefile里添加ipset依赖...不得不说,我还是编译完了,上机测试才发现op默认是没有ipset编译进去的...
您好,
请教一下如何编译出mips_24kc的ipk呢,默认编译出来的包是chinadns-ng_1.0-beta.23-1_ar71xx.ipk,无法在我的NETGEAR WNDR3800上运行,好像是34kc的?
我的设备信息如下:
root@OpenWrt:/tmp# cat /proc/cpuinfo
system type : Atheros AR7161 rev 2
machine : NETGEAR WNDR3700/WNDR3800/WNDRMAC
processor : 0
cpu model : MIPS 24Kc V7.4
BogoMIPS : 452.19
wait instruction : yes
microsecond timers : yes
tlb_entries : 16
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
假如需要使用 LuCI 用户界面,可以参考以下链接:
#!/bin/sh -e
[ -d /etc/chinadns-ng ] || mkdir /etc/chinadns-ng
reload=0
for item in chnroute/chnroute chnroute/chnroute6 gfwlist/gfwlist chinalist/chinalist
do
file=${item##*/}
localsize=`wc -c /etc/chinadns-ng/${file}.txt | awk '{print $1}'`
remotesize=`curl -s -I https://raw.githubusercontent.com/pexcn/daily/gh-pages/${item}.txt | grep -i "Content-Length:" | awk '{print $2}'`
if [ $localsize != $remotesize ]; then
wget --no-dns-cache --no-check-certificate -4 https://raw.githubusercontent.com/pexcn/daily/gh-pages/${item}.txt -O /tmp/${file}.tmp && [ "$?" == "0" ] && mv -f /tmp/${file}.tmp /etc/chinadns-ng/${file}.txt && reload=1 && echo "update ${file}, size ${localsize} -> ${remotesize}" || "update ${file} failed"
else
echo "ignore ${file}, size ${localsize}"
fi
done
if [ $reload == 1 ]; then
/etc/init.d/chinadns-ng restart
fi
我加了 -v 参数,但是却没有看见日志生成。不知道是不是我找的位置不对。
trust_dns 设置两个dns,工作正常
设置三个dns,出现Instance chinadns-ng::chinadns-ng-3 s in a crash loop 6 crashes, 0 seconds since last crash
每次reload都会增加一条,loop 7,loop8,一直往上加。
我看了下,原版的chinadns-ng好像就是这样设置的。
不过相比之下,我在原来的chinadns上用了好多个dns地址.....
看可执行文件使用的是ipset方案
只运行git clone -b luci https://github.com/pexcn/openwrt-chinadns-ng.git package/luci-app-chinadns-ng
时
https://github.com/w311ang/Actions-OpenWrt-Phicomm-K2P/runs/2905666006?check_suite_focus=true
package/Makefile:66: recipe for target 'package/install' failed
* pkg_hash_check_unresolved: cannot find dependency chinadns-ng for luci-app-chinadns-ng
make[2]: Leaving directory '/workdir/openwrt'
* pkg_hash_fetch_best_installation_candidate: Packages for luci-app-chinadns-ng found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package luci-app-chinadns-ng.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-i18n-chinadns-ng-zh-cn:
* chinadns-ng
* opkg_install_cmd: Cannot install package luci-i18n-chinadns-ng-zh-cn.
make[2]: *** [package/install] Error 255
make[1]: *** [/workdir/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
package/Makefile:111: recipe for target '/workdir/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install' failed
make[1]: Leaving directory '/workdir/openwrt'
make: *** [world] Error 2
/workdir/openwrt/include/toplevel.mk:228: recipe for target 'world' failed
当还运行git clone https://github.com/pexcn/openwrt-chinadns-ng.git package/chinadns-ng
时
https://github.com/w311ang/Actions-OpenWrt-Phicomm-K2P/runs/2906628252?check_suite_focus=true
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/chinalist.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/chnroute.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/chnroute6.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/gfwlist.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/config/chinadns-ng
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/chinadns-ng
But that file is already provided by package * chinadns-ng
* opkg_install_cmd: Cannot install package luci-app-chinadns-ng.
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/chinalist.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/chnroute.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/chnroute6.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/chinadns-ng/gfwlist.txt
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/config/chinadns-ng
But that file is already provided by package * chinadns-ng
* check_data_file_clashes: Package luci-app-chinadns-ng wants to install file /workdir/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/chinadns-ng
But that file is already provided by package * chinadns-ng
* opkg_install_cmd: Cannot install package luci-i18n-chinadns-ng-zh-cn.
make[2]: *** [package/install] Error 255
make[1]: *** [/workdir/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
make: *** [world] Error 2
package/Makefile:66: recipe for target 'package/install' failed
make[2]: Leaving directory '/workdir/openwrt'
package/Makefile:111: recipe for target '/workdir/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install' failed
make[1]: Leaving directory '/workdir/openwrt'
/workdir/openwrt/include/toplevel.mk:228: recipe for target 'world' failed
#27, I'll handle with it when I have time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.