Giter VIP home page Giter VIP logo

dns2tcp's Introduction

dns2tcp

一个 DNS 实用工具,用于将 DNS 查询从 UDP 转为 TCP。

当然有很多 DNS 工具都可以实现这个功能,比如 pdnsd、dnsforwarder;但如果你只是想使用其 UDP 转 TCP 功能(比如配合 dnsmasq,将 dnsmasq 向上游发出的 DNS 查询从 UDP 转为 TCP),那么 dns2tcp 可能是更好的选择。

dns2tcp 设计的非常简洁以及易用,它不需要任何配置文件,在命令行参数中指定一个 本地 UDP 监听地址 以及一个 远程 DNS 服务器地址(该 DNS 服务器支持 TCP 查询)即可,没有任何多余功能。

如何编译

为了方便使用,releases 页面发布了 linux 下常见架构的 musl 静态链接二进制。

git clone https://github.com/zfl9/dns2tcp
cd dns2tcp
make && sudo make install

dns2tcp 默认安装到 /usr/local/bin/dns2tcp,可安装到其它目录,如 make install DESTDIR=/opt/local/bin

交叉编译时只需指定 CC 变量,如 make CC=aarch64-linux-gnu-gcc(若报错,请先执行 make clean,然后再试)。

如何运行

# sh/bash 可以不加引号,zsh 必须加引号,防止#被转义
# 好吧,这里我偷了下懒,端口号是必须指定的,即使是 53
# UPDATE: 从 v1.1.1 版本开始可以省略端口号,默认是 53
dns2tcp -L "127.0.0.1#5353" -R "8.8.8.8#53"

# 如果想在后台运行,可以这样做:
(dns2tcp -L "127.0.0.1#5353" -R "8.8.8.8#53" </dev/null &>>/var/log/dns2tcp.log &)
  • -L 选项指定本地监听地址,该监听地址接受 UDP 协议的 DNS 查询。
  • -R 选项指定远程 DNS 服务器地址,该 DNS 服务器应支持 TCP 查询。

小技巧

借助 iptables,将本机发往 8.8.8.8:53 的 UDP 查询请求,强行重定向至本机 dns2tcp 监听端口,这样就可以不用修改原有 dns 组件的配置,无感转换为 TCP 查询。还是上面那个例子,在启动 dns2tcp 之后,再执行如下 iptables 命令:

# 将目标地址为 8.8.8.8:53/udp 的包重定向至 dns2tcp 监听端口,实现透明 udp2tcp 转换
iptables -t nat -A OUTPUT -p udp -d 8.8.8.8 --dport 53 -j REDIRECT --to-ports 5353

你可以在本机使用 dig @8.8.8.8 baidu.com 测试,观察 dns2tcp 日志(带上 -v),就会发现走 TCP 出去了。

全部参数

usage: dns2tcp <-L listen> <-R remote> [-s syncnt] [-6rvVh]
 -L <ip[#port]>          udp listen address, this is required
 -R <ip[#port]>          tcp remote address, this is required
 -s <syncnt>             set TCP_SYNCNT(max) for remote socket
 -6                      enable IPV6_V6ONLY for listen socket
 -r                      enable SO_REUSEPORT for listen socket
 -v                      print verbose log, default: <disabled>
 -V                      print version number of dns2tcp and exit
 -h                      print help information of dns2tcp and exit
bug report: https://github.com/zfl9/dns2tcp. email: [email protected]

-s:对TCP套接字设置TCP_SYNCNT,其值将影响TCP连接超时时间。

-6:对UDP套接字设置IPV6_V6ONLY,建议始终启用,把 v4 和 v6 监听严格区分开。

-r:对UDP套接字设置SO_REUSEPORT,用于多进程负载均衡,Linux 3.9+ 开始可用。

dns2tcp's People

Contributors

zfl9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dns2tcp's Issues

windows support?

Is there any released binary for win10 64bit? or a workable project for compiling?

ubuntu 18.04安装不了,求指导

make && sudo make install后报错,如下:

gcc -w -O2 -c libev/ev.c -o ev.o
make: gcc: Command not found
Makefile:31: recipe for target 'ev.o' failed
make: *** [ev.o] Error 127

[Suggestion] Inverse mode

I want to forward a DNS port to a container in TCP format, but I couldn't find any program on Github that forwards DNS queries on UDP port and provides a TCP port for listening.

This mode would be like this:

[Remote UDP DNS address#port] <===> [dns2tcp] <===> [Listening TCP DNS address#port]

There is no program that make this possible yet, so I am requesting this.

make遇错

hi。

yudeMacBook-Air:dns2tcp brite$ make
gcc -w -O2 -c libev/ev.c -o ev.o
gcc -std=c99 -Wall -Wextra -O2 -c dns2tcp.c -o dns2tcp.o
dns2tcp.c:87:49: warning: missing field 'sin6_family' initializer
      [-Wmissing-field-initializers]
static skaddr6_t  g_listen_skaddr           = {0};
                                                ^
dns2tcp.c:90:49: warning: missing field 'sin6_family' initializer
      [-Wmissing-field-initializers]
static skaddr6_t  g_remote_skaddr           = {0};
                                                ^
dns2tcp.c:371:34: warning: missing field 'pending' initializer
      [-Wmissing-field-initializers]
    evio_t *watcher = &(evio_t){0};
                                 ^
3 warnings generated.
gcc -std=c99 -Wall -Wextra -O2 -s -o dns2tcp dns2tcp.o ev.o -lm
ld: warning: option -s is obsolete and being ignored
yudeMacBook-Air:dns2tcp brite$

如何解决?

此插件编译失败

使用的是https://github.com/P3TERX/Actions-OpenWrt
在线编译
报错内容
make[4]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1'
mipsel-openwrt-linux-musl-gcc -std=c99 -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1=dns2tcp-1.1.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fpic -c libev/ev.c -o libev/ev.o
libev/ev.c:2139:31: warning: 'ev_default_loop_ptr' initialized and declared 'extern'
EV_API_DECL struct ev_loop ev_default_loop_ptr = 0; / needs to be initialised to make it a definition despite extern */
^~~~~~~~~~~~~~~~~~~
{standard input}: Assembler messages:
{standard input}:4260: Error: opcode not supported on this processor: mips2 (mips2) sync' {standard input}:4535: Error: opcode not supported on this processor: mips2 (mips2) sync'
make[4]: *** [Makefile:25: libev/ev.o] Error 1
make[4]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1'
make[3]: *** [Makefile:45: /workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1/.built] Error 2
make[3]: Leaving directory '/workdir/openwrt/feeds/small/dns2tcp'
time: package/feeds/small/dns2tcp/compile#0.35#0.07#0.39
ERROR: package/feeds/small/dns2tcp failed to build.
make[2]: *** [package/Makefile:116: package/feeds/small/dns2tcp/compile] Error 1
make[2]: Leaving directory '/workdir/openwrt'
make[1]: *** [package/Makefile:110: /workdir/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/workdir/openwrt'
make: *** [/workdir/openwrt/include/toplevel.mk:231: world] Error 2
Error: Process completed with exit code 2.

编译失败

环境信息:

  • 系统:ubuntu18.04
  • gcc:version 6.5.0
gcc -std=c99 -Wall -Wextra -O3 -pthread  -c dns2tcp.c -o dns2tcp.o
dns2tcp.c: In function ‘main’:
dns2tcp.c:179:44: error: incompatible type for argument 2 of ‘uv_udp_bind’
     int retval = uv_udp_bind(g_udp_server, (void *)&g_listen_skaddr, (g_listen_skaddr.sin6_family == AF_INET) ? 0 : UV_UDP_IPV6ONLY);
                                            ^
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:832:15: note: expected ‘struct sockaddr_in’ but argument is of type ‘void *’
 UV_EXTERN int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr,
               ^~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c:181:68: error: incompatible type for argument 1 of ‘uv_strerror’
         LOGERR("[main] bind failed: (%d) %s", -retval, uv_strerror(retval));
                                                                    ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘int’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
dns2tcp.c:184:37: warning: passing argument 2 of ‘uv_udp_recv_start’ from incompatible pointer type [-Wincompatible-pointer-types]
     uv_udp_recv_start(g_udp_server, udp_alloc_cb, udp_recv_cb);
                                     ^~~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:973:15: note: expected ‘uv_alloc_cb {aka struct <anonymous> (*)(struct uv_handle_s *, long unsigned int)}’ but argument is of type ‘void (*)(uv_handle_t *, size_t,  uv_buf_t *) {aka void (*)(struct uv_handle_s *, long unsigned int,  struct <anonymous> *)}’
 UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
               ^~~~~~~~~~~~~~~~~
dns2tcp.c:184:51: warning: passing argument 3 of ‘uv_udp_recv_start’ from incompatible pointer type [-Wincompatible-pointer-types]
     uv_udp_recv_start(g_udp_server, udp_alloc_cb, udp_recv_cb);
                                                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:973:15: note: expected ‘uv_udp_recv_cb {aka void (*)(struct uv_udp_s *, long int,  struct <anonymous>,  struct sockaddr *, unsigned int)}’ but argument is of type ‘void (*)(uv_udp_t *, ssize_t,  const uv_buf_t *, const skaddr_t *, unsigned int) {aka void (*)(struct uv_udp_s *, long int,  const struct <anonymous> *, const struct sockaddr *, unsigned int)}’
 UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
               ^~~~~~~~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c: In function ‘udp_recv_cb’:
dns2tcp.c:199:75: error: incompatible type for argument 1 of ‘uv_strerror’
         LOGERR("[udp_recv_cb] recv failed: (%zd) %s", -nread, uv_strerror(nread));
                                                                           ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘ssize_t {aka long int}’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
dns2tcp.c:232:54: error: incompatible type for argument 3 of ‘uv_tcp_connect’
     int retval = uv_tcp_connect(connreq, tcp_client, (void *)&g_remote_skaddr, tcp_connect_cb);
                                                      ^
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:745:15: note: expected ‘struct sockaddr_in’ but argument is of type ‘void *’
 UV_EXTERN int uv_tcp_connect(uv_connect_t* req, uv_tcp_t* handle,
               ^~~~~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c:234:78: error: incompatible type for argument 1 of ‘uv_strerror’
         LOGERR("[udp_recv_cb] connect failed: (%d) %s", -retval, uv_strerror(retval));
                                                                              ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘int’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c: In function ‘tcp_connect_cb’:
dns2tcp.c:252:81: error: incompatible type for argument 1 of ‘uv_strerror’
         LOGERR("[tcp_connect_cb] connect failed: (%d) %s", -status, uv_strerror(status));
                                                                                 ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘int’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c:265:79: error: incompatible type for argument 1 of ‘uv_strerror’
         LOGERR("[tcp_connect_cb] write failed: (%d) %s", -status, uv_strerror(status));
                                                                               ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘int’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c: In function ‘tcp_write_cb’:
dns2tcp.c:281:77: error: incompatible type for argument 1 of ‘uv_strerror’
         LOGERR("[tcp_write_cb] write failed: (%d) %s", -status, uv_strerror(status));
                                                                             ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘int’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
dns2tcp.c:287:31: warning: passing argument 2 of ‘uv_read_start’ from incompatible pointer type [-Wincompatible-pointer-types]
     uv_read_start(tcp_client, tcp_alloc_cb, tcp_read_cb);
                               ^~~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:618:15: note: expected ‘uv_alloc_cb {aka struct <anonymous> (*)(struct uv_handle_s *, long unsigned int)}’ but argument is of type ‘void (*)(uv_handle_t *, size_t,  uv_buf_t *) {aka void (*)(struct uv_handle_s *, long unsigned int,  struct <anonymous> *)}’
 UV_EXTERN int uv_read_start(uv_stream_t*, uv_alloc_cb alloc_cb,
               ^~~~~~~~~~~~~
dns2tcp.c:287:45: warning: passing argument 3 of ‘uv_read_start’ from incompatible pointer type [-Wincompatible-pointer-types]
     uv_read_start(tcp_client, tcp_alloc_cb, tcp_read_cb);
                                             ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:618:15: note: expected ‘uv_read_cb {aka void (*)(struct uv_stream_s *, long int,  struct <anonymous>)}’ but argument is of type ‘void (*)(uv_stream_t *, ssize_t,  const uv_buf_t *) {aka void (*)(struct uv_stream_s *, long int,  const struct <anonymous> *)}’
 UV_EXTERN int uv_read_start(uv_stream_t*, uv_alloc_cb alloc_cb,
               ^~~~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c: In function ‘tcp_read_cb’:
dns2tcp.c:301:96: error: incompatible type for argument 1 of ‘uv_strerror’
         if (nread != UV_EOF) LOGERR("[tcp_read_cb] read failed: (%zd) %s", -nread, uv_strerror(nread));
                                                                                                ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘ssize_t {aka long int}’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
dns2tcp.c:339:13: warning: implicit declaration of function ‘uv_udp_try_send’ [-Wimplicit-function-declaration]
     nread = uv_udp_try_send(g_udp_server, uvbufs, 1, (void *)&tcp_data->srcaddr);
             ^~~~~~~~~~~~~~~
In file included from dns2tcp.c:2:0:
dns2tcp.c:341:75: error: incompatible type for argument 1 of ‘uv_strerror’
         LOGERR("[tcp_read_cb] send failed: (%zd) %s", -nread, uv_strerror(nread));
                                                                           ^
logutils.h:24:19: note: in definition of macro ‘LOGERR’
                 ##__VA_ARGS__);                                             \
                   ^~~~~~~~~~~
In file included from dns2tcp.c:4:0:
/usr/include/uv.h:450:23: note: expected ‘uv_err_t {aka struct uv_err_s}’ but argument is of type ‘ssize_t {aka long int}’
 UV_EXTERN const char* uv_strerror(uv_err_t err);
                       ^~~~~~~~~~~
Makefile:26: recipe for target 'dns2tcp.o' failed
make: *** [dns2tcp.o] Error 1

能否增加一个静态编译的选项?

比如:make STATIC=1, 我试了一下这样改是可以静态链接的

diff --git a/Makefile b/Makefile
index a66b4cb..37153c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 CC = gcc
-CFLAGS = -std=c99 -Wall -Wextra -O3
+CFLAGS = -std=c99 -Wall -Wextra -O3 -pipe
 INCLUDES =
-LDFLAGS =
-LIBS = -luv
+LDFLAGS = -Wl,--build-id=none -static
+LIBS = -luv -lpthread
 SRCS = netutils.c dns2tcp.c
 OBJS = $(SRCS:.c=.o)
 MAIN = dns2tcp
root@ROC:~/dns2tcp# make
gcc -std=c99 -Wall -Wextra -O3 -pipe  -c netutils.c -o netutils.o
gcc -std=c99 -Wall -Wextra -O3 -pipe  -c dns2tcp.c -o dns2tcp.o
gcc -std=c99 -Wall -Wextra -O3 -pipe  -s -o dns2tcp netutils.o dns2tcp.o -Wl,--build-id=none -static -luv -lpthread
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libuv.a(libuv_la-core.o): In function `uv__getpwuid_r':
(.text+0x16e0): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
root@ROC:~/dns2tcp# file dns2tcp
dns2tcp: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, stripped
root@ROC:~/dns2tcp# nm dns2tcp
nm: dns2tcp: no symbols
root@ROC:~/dns2tcp# ldd dns2tcp
        not a dynamic executable
root@ROC:~/dns2tcp# ./dns2tcp -h
usage: dns2tcp <-L LISTEN_ADDR> <-R REMOTE_ADDR> [-vVh]
 -L <ip#port>           udp listen address, it is required
 -R <ip#port>           tcp remote address, it is required
 -v                     print verbose log, default: <disabled>
 -V                     print version number of dns2tcp and exit
 -h                     print help information of dns2tcp and exit
bug report: https://github.com/zfl9/dns2tcp. email: [email protected]

旁路由不支持tproxy没有mangle表,可以通过如下方式解决DNS污染问题吗

我希望设置一个旁路由实现上网功能,但是小主机不支持tproxy也没有mangle表。我想怎么解决DNS污染问题。

  1. 设置v2ray
  2. 设置iptables
iptables -t nat -A v2ray -p tcp -j REDIRECT --to-ports 1099
iptables -t nat -I PREROUTING -p tcp -j v2ray

到这一步局域网内的设备已经能够继续进行科学上网。
3. dns2tcp

dns2tcp -L "127.0.0.1#5353" -R "8.8.8.8#53"
iptables -t nat -A OUTPUT -p PREROUTING -d 8.8.8.8 --dport 53 -j REDIRECT --to-ports 1099

通过上面的命令能够解决DNS污染问题呢,怎么验证是否解决了DNS污染问题

大佬你好,我在编译最新版的过程中遇到了编译失败,能帮忙看看怎么解决吗?谢谢!

具体编译信息如下:
make[3]: Entering directory '/workdir/openwrt/feeds/passwall_packages/dns2tcp'
rm -f /workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1/.built
touch /workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1/.built_check
CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1=dns2tcp-1.1.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fpic -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/include -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/fortify -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1=dns2tcp-1.1.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fpic -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/include -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/fortify -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include " LDFLAGS="-L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib -znow -zrelro " make -C /workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1/. AR="mipsel-openwrt-linux-musl-gcc-ar" AS="mipsel-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1=dns2tcp-1.1.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fpic" LD=mipsel-openwrt-linux-musl-ld NM="mipsel-openwrt-linux-musl-gcc-nm" CC="mipsel-openwrt-linux-musl-gcc" GCC="mipsel-openwrt-linux-musl-gcc" CXX="mipsel-openwrt-linux-musl-g++" RANLIB="mipsel-openwrt-linux-musl-gcc-ranlib" STRIP=mipsel-openwrt-linux-musl-strip OBJCOPY=mipsel-openwrt-linux-musl-objcopy OBJDUMP=mipsel-openwrt-linux-musl-objdump SIZE=mipsel-openwrt-linux-musl-size CROSS="mipsel-openwrt-linux-musl-" ARCH="mipsel" CFLAGS="-std=c99 -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1=dns2tcp-1.1.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fpic" EVCFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1=dns2tcp-1.1.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fpic" ;
make[4]: Entering directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1'
mipsel-openwrt-linux-musl-gcc -std=c99 -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1=dns2tcp-1.1.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fpic -c libev/ev.c -o libev/ev.o
libev/ev.c:2139:31: warning: 'ev_default_loop_ptr' initialized and declared 'extern'
EV_API_DECL struct ev_loop ev_default_loop_ptr = 0; / needs to be initialised to make it a definition despite extern */
^~~~~~~~~~~~~~~~~~~
{standard input}: Assembler messages:
{standard input}:4260: Error: opcode not supported on this processor: mips2 (mips2) sync' {standard input}:4535: Error: opcode not supported on this processor: mips2 (mips2) sync'
make[4]: *** [Makefile:25: libev/ev.o] Error 1
make[4]: Leaving directory '/workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1'
make[3]: *** [Makefile:45: /workdir/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp-1.1.1/.built] Error 2
make[3]: Leaving directory '/workdir/openwrt/feeds/passwall_packages/dns2tcp'
time: package/feeds/passwall_packages/dns2tcp/compile#0.33#0.04#0.36
ERROR: package/feeds/passwall_packages/dns2tcp failed to build.
make[2]: *** [package/Makefile:120: package/feeds/passwall_packages/dns2tcp/compile] Error 1

大佬你好,我在编译过程中遇到了一点问题,能否解答一下

这是错误的详细情况·:
HEAD is now at 558b07e Update README.md
Packing checkout...
touch /home/chen/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp/dns2tcp-1.1.0-558b07e4c1f9bd5be19e60892a0bce7661ed99a5/.prepared_e95070423ea6a8a85a889c519746504f_6664517399ebbbc92a37c5bb081b5c53_check
. /home/chen/openwrt/include/shell.sh; gzip -dc /home/chen/openwrt/dl/dns2tcp-1.1.0-558b07e4c1f9bd5be19e60892a0bce7661ed99a5.tar.gz | tar -C /home/chen/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp/dns2tcp-1.1.0-558b07e4c1f9bd5be19e60892a0bce7661ed99a5/.. -xf -
[ ! -d ./src/ ] || cp -fpR ./src/. /home/chen/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp/dns2tcp-1.1.0-558b07e4c1f9bd5be19e60892a0bce7661ed99a5

Applying ./patches/001-build-with-gcc-O3-optimizations.patch using plaintext:
patching file Makefile
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
Patch failed! Please fix ./patches/001-build-with-gcc-O3-optimizations.patch!
make[3]: *** [Makefile:54: /home/chen/openwrt/build_dir/target-mipsel_24kc_musl/dns2tcp/dns2tcp-1.1.0-558b07e4c1f9bd5be19e60892a0bce7661ed99a5/.prepared_e95070423ea6a8a85a889c519746504f_6664517399ebbbc92a37c5bb081b5c53] Error 1
make[3]: Leaving directory '/home/chen/openwrt/feeds/kiddin9/dns2tcp'
time: package/feeds/kiddin9/dns2tcp/compile#0.38#0.14#2.58
ERROR: package/feeds/kiddin9/dns2tcp failed to build.
make[2]: *** [package/Makefile:116: package/feeds/kiddin9/dns2tcp/compile] Error 1
make[2]: Leaving directory '/home/chen/openwrt'
make[1]: *** [package/Makefile:110: /home/chen/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/chen/openwrt'
make: *** [/home/chen/openwrt/include/toplevel.mk:230:world] 错误 2
image

请问可以屏蔽AAAA的返回记录吗?

现在用于路由器上专门解析GFWLIST,虽然dnsmasq可以手动屏蔽指定域名的V6,但是规则多了感觉性能有点下降,不知道能不能把屏蔽V6做到dns2tcp上。。。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.