Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问一下能否支持通过tcp/socks5访问上游 #172

Closed
smaller09 opened this issue May 15, 2024 · 3 comments
Closed

请问一下能否支持通过tcp/socks5访问上游 #172

smaller09 opened this issue May 15, 2024 · 3 comments

Comments

@smaller09
Copy link

目前我自用的方案是 dnsmasq+gfwlist, 使用dns2socks+naive作为分流上游。
好处是需要通过代理来访问的网站其域名解释同样在远端,那么返回的地址是到远端最快的地址。
现在情况是dns2socks太老,和目前内核的gro似乎有冲突。想试试大神您的方案。

@zfl9
Copy link
Owner

zfl9 commented May 15, 2024

我记得naive支持redir://传入协议,虽然我不知道你的具体使用环境,但根据你的描述。我感觉增加一个iptables规则,就能将dns访问重定向至naive,从而走代理

假设你配置的dns上游是tcp://8.8.8.8,并且naive的redir监听端口是1088,则

iptables -t nat -A OUTPUT -p tcp -d 8.8.8.8 --dport 53 -j REDIRECT --to-ports 1088

@zfl9
Copy link
Owner

zfl9 commented May 15, 2024

我的想法是,如果能通过其他方式解决(比如上面这种简单方法),就尽量不给chinadns-ng增加过多代码。

chinadns-ng基本都是运行在Linux透明代理环境中,所以我觉得加个iptables/nftables规则应该是比较轻松自然的事。

@smaller09
Copy link
Author

smaller09 commented May 17, 2024

由于我之前是用nftable来实现多naive后端负债均衡,所以一直是只用socks5,当然通过ipt2socks也是可以实现dns访问的,就是多了一层感觉不够简洁,现在naive支持了so_reuseport,可以试试直接chinadns-ng+naive(redir)

@zfl9 zfl9 closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants