Removed according to regulations.
shadowsocks / chinadns Goto Github PK
View Code? Open in Web Editor NEWProtect yourself against DNS poisoning in China.
License: GNU General Public License v3.0
Protect yourself against DNS poisoning in China.
License: GNU General Public License v3.0
Removed according to regulations.
dig @192.168.199.192 +time=1800 twitter.com
并且 chinadns -v 启动,发现抢答内容被filter了,但是真正的返回却不见了。
所以现象就是长时间没有返回任何内容…
Example usage:
Route table:
China DNS rule:
Thus we both resolve China IP locally, and resolve foreign IP on VPN/ss server locally. (e.g. get JP IP(not CN IP) when trying to resolve apple.com via JP VPN; get CN IP when trying to resolve taobao.com via direct).
This is the fastest solution we can get.
on openwrt it is slow
add -v
目前无论是 chinadns -h
还是 chinadns -v
都看不到当前使用的版本号。 或者能不能像 python 这样,
python -v
是 verbose,python -V
是 print the Python version number
打印版本号可以帮助确定当前版本是否低于最新版。
low priority
Check DNSSEC support during configure time.
https://www.sourceware.org/ml/glibc-cvs/2009-q3/msg00079.html
You should have at least one Chinese DNS and one foreign DNS when chnroutes is enabled
第一次试用这个软件,nslookup各种超时,换了好几个版本,还以为是重大bug,后来读了代码才发现queue那里的todo。
个人感觉独立id并不麻烦,应该可以直接用queue数组的下标作为远程查询的id,查找也不用再去循环一次了。
It would be very handy when people use openwrt in the vm or on the bare-metal.
Thanks,
Hanfei
启动时DNS指定 218.85.157.99,208.67.222.222,8.8.8.8,会导致facebook解析到污染IP 37.61.54.158
我是福建电信的网络,ISP默认DNS是218.85.157.99,这个DNS延时只有几毫秒,所以我希望能用这个来解析不受污染的
Segmentation fault
环境:OpenWrt Chaos Calmer r42397 / LuCI Trunk (svn-r10521)
硬件:TP-843N 16M/64M
需要提供什么资料吗?
make[5]: Nothing to be done for install-data-am'. make[5]: Leaving directory
/home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/src'
make[4]: Leaving directory /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/src' make[4]: Entering directory
/home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4'
make[5]: Entering directory /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4' make[5]: Nothing to be done for
install-exec-am'.
test -z "/usr/share" || /bin/mkdir -p "/home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/ipkg-install/usr/share"
/usr/bin/install -c -m 644 iplist.txt chnroute.txt '/home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/ipkg-install/usr/share'
make[5]: Leaving directory /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4' make[4]: Leaving directory
/home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4'
make[3]: Leaving directory /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4' touch /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/.built mkdir -p /home/wrt/gargoyle/custom-src/bin/ar71xx/packages /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/ipkg-ar71xx/ChinaDNS-C/CONTROL /home/wrt/gargoyle/custom-src/staging_dir/target-mips_r2_uClibc-0.9.33.2/pkginfo install -d -m0755 /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/ipkg-ar71xx/ChinaDNS-C/etc/init.d install -m0600 ../iplist.txt /home/wrt/gargoyle/custom-src/build_dir/target-mips_r2_uClibc-0.9.33.2/ChinaDNS-C-/chinadns-c-1.1.4/ipkg-ar71xx/ChinaDNS-C/etc/chinadns_iplist.txt install: cannot stat
../iplist.txt': No such file or directory
make[2]: *** [/home/wrt/gargoyle/custom-src/bin/ar71xx/packages/ChinaDNS-C_1.1.4_ar71xx.ipk] Error 1
make[2]: Leaving directory /home/wrt/gargoyle/custom-src/package/chinadns' make[1]: *** [package/chinadns/compile] Error 2 make[1]: Leaving directory
/home/wrt/gargoyle/custom-src'
make: *** [package/chinadns/compile] Error 2
wrt@power:~/gargoyle/custom-src$
I just run this tool in OS X
I found it is not stable. Detail:
When I ran it at first time, I can visit google and youtube smoothly.
But after a few minutes, I restarted it, I can't visit google and youtube any more. It didn't seem to work.
I ran it in verbose logging mode, but when I request www.google.com site in chrome, nothing is outputted
When I nslookup www.google.com, it will output some request log.
Do you meet same problem in Linux system? Or this problem is only for Mac OS X?
我的启动方式是这样的, 第二个服务器是我在美国的VPS上自建的DNS
$ ./src/chinadns -l iplist.txt -c chnroute.txt -p 5354 -s 114.114.114.114,23.29.xx.xx -v
然后查询
$ dig +short @127.0.0.1 -p 5354 www.baidu.com
www.a.shifen.com.
180.76.3.151
$ iploc 180.76.3.151
** 香港
$ dig +short @127.0.0.1 -p 5354 player.letvcdn.com
player.letvcdn.net.
player.le-tv.com.
65.255.32.137
65.255.32.136
$ iploc 65.255.32.137
美国 美国
日志如下:
Mon Aug 11 00:21:01 2014 request www.baidu.com
Mon Aug 11 00:21:01 2014 response www.baidu.com from 114.114.114.114:53 - 58.217.200.13, filter
Mon Aug 11 00:21:01 2014 response www.baidu.com from 23.29.125.35:53 - 180.76.3.151, pass
Mon Aug 11 00:24:08 2014 request player.letvcdn.com
Mon Aug 11 00:24:08 2014 response player.letvcdn.com from 114.114.114.114:53 - 115.231.150.131, filter
Mon Aug 11 00:24:08 2014 response player.letvcdn.com from 23.29.125.35:53 - 65.255.32.137, 65.255.32.136, pass
其中114dns返回的地址物理位置如下:
#www.baidu.com
iploc 58.217.200.13
** 江苏 南京
#player.letvcdn.com
iploc 115.231.150.131
** 浙江
RT,目前的设置(和是否使用iptables)都是在init.d中设置,修改是否复杂暂且不论,在升级时文件会被覆盖是一个问题。
个人例子:
1、需要注释掉iptables以使用dnsmasq(dnsmasq也是一个推荐选项),然后这个修改需要先stop(以在iptables中删除redirect)、再修改、再start;
2、114dns在我的ISP表现效果不佳,结合chinadns的新策略,导致最终效果相当于等待(0.3秒)后一定返回国外DNS结果;同样,这项的修改我需要每次更新都进行处理。
另外,监听5353然后用iptables转发并不符合软件的正常逻辑,结果就是原53端口的DNS服务器正常运行但是被“掐断”;更加自然的逻辑是在“监听5353,更改现有程序如dnsmasq的上游”和“监听53,让用户关掉现有的dns服务”中二选一。
when restart service, always show
[v1.3]root@AsiaCloud007:~# /etc/init.d/chinadns restart
Terminated
The service name is "/etc/init.d/chinadns", "killall chinadns" can kill the service itself also.
So,
我的路由器ASUS RT-N16刷的是AsusWRT Merlin固件,里面配套使用的是Entware,安装percompile里的 ChinaDNS-C_1.1.2_brcm47xx.ipk提示
---------------------- 错误日志 ----------------------
chopin@vpn:~/Entware/openwrt_trunk$ make V=s package/ChinaDNS-C/openwrt/compile
make[1]: Entering directory /home/chopin/Entware/openwrt_trunk' make[2]: Entering directory
/home/chopin/Entware/openwrt_trunk/package/libs/toolchain'
WARNING: skipping libgfortran -- package not selected
make[2]: Leaving directory /home/chopin/Entware/openwrt_trunk/package/libs/toolchain' make[2]: Entering directory
/home/chopin/Entware/openwrt_trunk/package/ChinaDNS-C/openwrt'
. /home/chopin/Entware/openwrt_trunk/include/shell.sh; gzip -dc /home/chopin/Entware/openwrt_trunk/dl/chinadns-c-1.1.2.tar.gz | /bin/tar -C /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/.. -xf -
touch /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/.prepared_c9e4a321eca4140e5c6e97fd2357df6b
(cd /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2; rm -f aclocal.m4; if [ -f ./configure.ac ] || [ -f ./configure.in ]; then [ -d ./autom4te.cache ] && rm -rf autom4te.cache; [ -e ./config.rpath ] || ln -s /home/chopin/Entware/openwrt_trunk/scripts/config.rpath ./config.rpath; touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; AUTOM4TE=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/autom4te AUTOCONF=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/autoconf AUTOMAKE=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/automake ACLOCAL=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/aclocal AUTOHEADER=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/autoheader LIBTOOLIZE=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/libtoolize LIBTOOL=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/libtool M4=/home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/m4 AUTOPOINT=true /home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/autoreconf -v -f -i -s -B /home/chopin/Entware/openwrt_trunk/staging_dir/host/share/aclocal -I /home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/host/share/aclocal -I /home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/share/aclocal -I m4 -I . . || true; fi; );
autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: /home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/aclocal -I /home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/host/share/aclocal -I /home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/share/aclocal -I m4 -I . --force autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/autoconf --include=/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/host/share/aclocal --include=/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/share/aclocal --include=m4 --include=. --prepend-include=/home/chopin/Entware/openwrt_trunk/staging_dir/host/share/aclocal --force autoreconf: running: /home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/autoheader --include=/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/host/share/aclocal --include=/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/share/aclocal --include=m4 --include=. --prepend-include=/home/chopin/Entware/openwrt_trunk/staging_dir/host/share/aclocal --force autoreconf: running: /home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/automake --add-missing --force-missing autoreconf: Leaving directory
.'
(cd /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/./; if [ -x ./configure ]; then /usr/bin/find /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/ -name config.guess | xargs -r chmod u+w; /usr/bin/find /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/ -name config.guess | xargs -r -n1 cp /home/chopin/Entware/openwrt_trunk/scripts/config.guess; /usr/bin/find /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/ -name config.sub | xargs -r chmod u+w; /usr/bin/find /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/ -name config.sub | xargs -r -n1 cp /home/chopin/Entware/openwrt_trunk/scripts/config.sub; AR=mipsel-linux-uclibc-ar AS="mipsel-linux-uclibc-gcc -c -O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves" LD=mipsel-linux-uclibc-ld NM=mipsel-linux-uclibc-nm CC="mipsel-linux-uclibc-gcc" GCC="mipsel-linux-uclibc-gcc" CXX="mipsel-linux-uclibc-g++" RANLIB=mipsel-linux-uclibc-ranlib STRIP=mipsel-linux-uclibc-strip OBJCOPY=mipsel-linux-uclibc-objcopy OBJDUMP=mipsel-linux-uclibc-objdump SIZE=mipsel-linux-uclibc-size CFLAGS="-O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves " CXXFLAGS="-O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves " CPPFLAGS="-I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/include -I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/include -I/opt/entware/toolchain-entware/include " LDFLAGS="-L/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/lib -L/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/lib -Wl,--dynamic-linker=/opt/lib/ld-uClibc.so.0 -Wl,-rpath,/opt/lib -Wl,-rpath-link=/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/lib -L/opt/entware/toolchain-entware/lib " ./configure --target=mipsel-linux-gnu --host=mipsel-linux-gnu --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/opt --exec-prefix=/opt --bindir=/opt/bin --sbindir=/opt/sbin --libexecdir=/opt/lib --sysconfdir=/opt/etc --datadir=/opt/share --localstatedir=/opt/var --mandir=/opt/man --infodir=/opt/info --disable-nls ; fi; )
configure: WARNING: unrecognized options: --disable-nls
configure: loading site script /home/chopin/Entware/openwrt_trunk/include/site/mipsel-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mipsel-linux-gnu-strip... mipsel-linux-uclibc-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for mipsel-linux-gnu-gcc... mipsel-linux-uclibc-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mipsel-linux-uclibc-gcc accepts -g... yes
checking for mipsel-linux-uclibc-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of mipsel-linux-uclibc-gcc... gcc3
checking for res_query in -lresolv... no
checking for res_query in -lresolv... yes
checking for sys/types.h... yes
checking for netinet/in.h... yes
checking for arpa/nameser.h... yes
checking for netdb.h... yes
checking for resolv.h... yes
checking how to run the C preprocessor... mipsel-linux-uclibc-gcc -E
checking for grep that handles long lines and -e... /home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/grep
checking for egrep... /home/chopin/Entware/openwrt_trunk/staging_dir/host/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for netdb.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for unistd.h... (cached) yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... (cached) yes
checking for inet_ntoa... yes
checking for memset... yes
checking for select... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strrchr... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
configure: WARNING: unrecognized options: --disable-nls
rm -f /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/.configured*
touch /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/.configured
CFLAGS="-O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves -I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/include -I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/include -I/opt/entware/toolchain-entware/include " CXXFLAGS="-O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves -I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/include -I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/include -I/opt/entware/toolchain-entware/include " LDFLAGS="-L/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/lib -L/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/lib -Wl,--dynamic-linker=/opt/lib/ld-uClibc.so.0 -Wl,-rpath,/opt/lib -Wl,-rpath-link=/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/lib -L/opt/entware/toolchain-entware/lib " make -C /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/. AR=mipsel-linux-uclibc-ar AS="mipsel-linux-uclibc-gcc -c -O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves" LD=mipsel-linux-uclibc-ld NM=mipsel-linux-uclibc-nm CC="mipsel-linux-uclibc-gcc" GCC="mipsel-linux-uclibc-gcc" CXX="mipsel-linux-uclibc-g++" RANLIB=mipsel-linux-uclibc-ranlib STRIP=mipsel-linux-uclibc-strip OBJCOPY=mipsel-linux-uclibc-objcopy OBJDUMP=mipsel-linux-uclibc-objdump SIZE=mipsel-linux-uclibc-size CROSS="mipsel-linux-uclibc-" ARCH="mipsel" ;
make[3]: Entering directory /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2' make all-recursive make[4]: Entering directory
/home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2'
Making all in src
make[5]: Entering directory /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/src' mipsel-linux-uclibc-gcc -DHAVE_CONFIG_H -I. -I.. -I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/include -I/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/include -I/opt/entware/toolchain-entware/include -O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves -MT chinadns.o -MD -MP -MF .deps/chinadns.Tpo -c -o chinadns.o chinadns.c mv -f .deps/chinadns.Tpo .deps/chinadns.Po mipsel-linux-uclibc-gcc -O2 -pipe -mips32 -mtune=mips32 -fno-caller-saves -L/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/lib -L/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/lib -Wl,--dynamic-linker=/opt/lib/ld-uClibc.so.0 -Wl,-rpath,/opt/lib -Wl,-rpath-link=/home/chopin/Entware/openwrt_trunk/staging_dir/target-mipsel-linux-gnu/opt/lib -L/opt/entware/toolchain-entware/lib -o chinadns chinadns.o -lresolv chinadns.o: In function
hostname_from_question':
chinadns.c:(.text+0xc4): undefined reference to __ns_parserr' chinadns.o: In function
should_filter_query':
chinadns.c:(.text+0x45c): undefined reference to __ns_parserr' chinadns.o: In function
main':
chinadns.c:(.text.startup+0xc14): undefined reference to __ns_initparse' chinadns.c:(.text.startup+0xe6c): undefined reference to
__ns_initparse'
collect2: ld returned 1 exit status
make[5]: *** [chinadns] Error 1
make[5]: Leaving directory /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/src' make[4]: *** [all-recursive] Error 1 make[4]: Leaving directory
/home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2'
make[3]: *** [all] Error 2
make[3]: Leaving directory /home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2' make[2]: *** [/home/chopin/Entware/openwrt_trunk/build_dir/target-mipsel-linux-gnu/ChinaDNS-C-/chinadns-c-1.1.2/.built] Error 2 make[2]: Leaving directory
/home/chopin/Entware/openwrt_trunk/package/ChinaDNS-C/openwrt'
make[1]: *** [package/ChinaDNS-C/openwrt/compile] Error 2
make[1]: Leaving directory `/home/chopin/Entware/openwrt_trunk'
make: *** [package/ChinaDNS-C/openwrt/compile] Error 2
目前chinadns 解析域名的至少 1秒以上,建议加速国内域名的解析速度。即对于返回国内的IP的域名解析,立刻返回结果。
Init script 里使用了 iptables -j REDIRECT. 这个功能由 iptables-mod-nat-extra 提供。
如题。
你好,我在 MW4530R 上使用了你的作品,最近在尝试将 gfwlist 解析成 ip,我开启了 70 个 goroutine 来同时进行域名解析时会导致 chinadns 退出,而在开启 10 个时是正常的,查看了 /tmp/log/
下的两个日志文件,无任何日志记录,是不是 chinadns 对于这个数量以上并发的解析请求会处理不过来?
解析程序见 https://github.com/everyx/gfw-iptable ,使用 Go 编写。
So there is no need to restart chinadns if the chnroute file is updated.
65.49.2.178, 69.55.52.253, 141.0.173.53, 159.24.3.173, 198.105.254.11, 203.73.211.69, 243.185.187.30
下面的好像是ytgate的
189.163.17.5 197.4.4.12 54.76.135.1 118.5.49.6 253.157.14.165 188.5.4.96 49.2.123.56 77.4.7.92
Add a check
在freebsd 8.2版本下./configure时提示以下错误:
configure: error: libresolv not found.
Google搜索了也没找到怎么在freebsd下安装libresolv相关包。
Someone does not need this feature.
how can we simulate the network in china on travis ci?
开启后在 OpenWRT 上 ping 和 resolveip 都不能用。
make all-recursive
make[1]: Entering directory `/root/src/chinadns-c-1.2.1'
Making all in src
make[2]: Entering directory `/root/src/chinadns-c-1.2.1/src'
gcc -g -O2 -o chinadns chinadns.o -lresolv
chinadns.o: In function `hostname_from_question':
/root/src/chinadns-c-1.2.1/src/chinadns.c:644: undefined reference to `__ns_parserr'
chinadns.o: In function `dns_handle_local':
/root/src/chinadns-c-1.2.1/src/chinadns.c:537: undefined reference to `__ns_initparse'
chinadns.o: In function `dns_handle_remote':
/root/src/chinadns-c-1.2.1/src/chinadns.c:572: undefined reference to `__ns_initparse'
chinadns.o: In function `should_filter_query':
/root/src/chinadns-c-1.2.1/src/chinadns.c:675: undefined reference to `__ns_parserr'
collect2: ld 返回 1
make[2]: *** [chinadns] 错误 1
make[2]: Leaving directory `/root/src/chinadns-c-1.2.1/src'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/root/src/chinadns-c-1.2.1'
make: *** [all] 错误 2
出错信息:
cc -Wall -O3 src/chinadns.c -lresolv -o chinadns
src/chinadns.c: In function 'parse_ip_list':
src/chinadns.c:281:3: warning: implicit declaration of function 'getline' [-Wimplicit-function-declaration]
/jffs/tmp/ccB9D6xr.o: In function hostname_from_question': chinadns.c:(.text+0x48): undefined reference to
__ns_parserr'
/jffs/tmp/ccB9D6xr.o: In function should_filter_query': chinadns.c:(.text+0x1f4): undefined reference to
__ns_parserr'
/jffs/tmp/ccB9D6xr.o: In function main': chinadns.c:(.text.startup+0x94c): undefined reference to
__ns_initparse'
chinadns.c:(.text.startup+0xbc0): undefined reference to `__ns_initparse'
collect2: ld returned 1 exit status
Makefile:7: recipe for target 'chinadns' failed
make: *** [chinadns] Error 1
我查了一下,说是目前 Tomato 使用的 uClibc 是不支持 -lresov 的(optware/entware下也不行)。我试了试静态编译,并把库指向编译好的 BIND9,也不行~
有没啥办法解决?或者 ns_parserr,ns_initparse 这两函数能用其他的替代么?
Sun Jan 25 14:04:54 2015 chinadns.c:368 fopen: No such file or directory
Sun Jan 25 14:04:54 2015 Can't open ip list: iplist.txt
如题。
域名是www.chinagfw.org
分别dig 国内和自建国外dns正常,dig openwrt上的chinadns的端口结果就是超时
为啥啊?
配置如下,国外的DNS由日本的VPS进行了UDP中转。我到VPS的ping值大约70ms
开启了双向解析
延迟部分测试了200 300 400MS,都没有用。
config chinadns
option enable '1'
option bidirectional '1'
option iplist '/etc/chinadns_iplist.txt'
option chnroute '/etc/chinadns_chnroute.txt'
option port '5301'
option server '114.114.114.114,127.0.0.1:5353'
option result_delay '0.4'
; <<>> DiG 9.9.1-P3 <<>> weibo.com @127.0.0.1 -p 5301
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42209
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;weibo.com. IN A
;; ANSWER SECTION:
weibo.com. 14 IN A 114.134.80.162
;; Query time: 472 msec
;; SERVER: 127.0.0.1#5301(127.0.0.1)
;; WHEN: Wed Jan 21 11:16:46 2015
;; MSG SIZE rcvd: 54
where is init.d script?
I had deployed the OpenWRT on my router with ss+chinadns successfully.
Then I tried to set auto update of Chinaroute on it with CL like these:
Then I found my proxy network got to be slow down significantly.
I checked the content of the updated ignore.list and it contains the update IPs from the apnic indeed.
How could this issue happen?
If I follow steps in README on how to install ChinaDNS-C on tomato, I will get an error like this:
undefined reference to 'rpl_malloc'
According to many articles, it may be a problem relating to ldconfig. I tried add brcm libs path to /etc/ld.so.conf.d but not working.
The only way to make 'make' work is to change .configure command to this:
ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ./configure --host=mipsel-linux --enable-static
Additionally, you have to scp iplist.txt
and chnroute.txt
to /jffs/ and manually start ChinaDNS with -c & -l parameters.
I don't know it is a problem relating to my environment or anything else. So please test with yourself.
Thanks!
Please provide
dig @8.8.8.8 domain.that.i.used
...
domain.that.i.used. 233 IN A 37.61.54.158
发现www.qq.com会被解析到香港IP上(配置的境外DNS用的是日本的),暂时还没发现其他国内域名会出这个问题
;; ANSWER SECTION:
www.qq.com. 270 IN A 202.55.10.190
www.qq.com. 270 IN A 202.55.10.189
;; Query time: 72 msec
;; SERVER: 192.168.1.1#5353(192.168.1.1)
国内DNS返回的是正常的
;; ANSWER SECTION:
www.qq.com. 291 IN A 61.135.157.156
;; Query time: 13 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
另外发现 1.2.0 在openwrt下一直会占用10%左右的CPU
我的启动选项是这样的
chinadns -l /etc/chinadns_iplist.txt -c /etc/chinadns_chnroute.txt -p 5353 -s 127.0.0.1,114.114.115.115,208.67.220.220:443, 8.8.4.4
然后 tail -f /var/log/chinadns.err.log
不断提示 chinadns.c:537 sendto: Destination address required
使用的版本:
OpenWRT: ChinaDNS-C_1.1.8_ar71xx.ipk
ipv6 environment was provided by tunnelbroker.net
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver iptochinadns
nameserver 8.8.8.8
nameserver 127.0.1.1
search sf.moevpn.com
# OpenDNS Fallback (configured by Netrunner in /etc/resolvconf/resolv.conf.d/tail).
nameserver 208.67.222.222
nameserver 208.67.220.220
$ wget twitter.com
--2015-01-30 17:01:36-- http://twitter.com/
Resolving twitter.com (twitter.com)...
if nameserver iptochinadns
was removed, wget works fine.
wget also works fine with option -4
.
could be a ipv6 issue as vagrant-landrush/landrush#33 stated.
maybe the same issue as
socketry/rubydns#26
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.