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

希望增加劫持 53 端口选项。 #44

Open
ghost opened this issue Jan 10, 2022 · 0 comments
Open

希望增加劫持 53 端口选项。 #44

ghost opened this issue Jan 10, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2022

Ubuntu 系统默认开启了 systemd-resolved ,占用了 53 端口,目前是两种方法解决:

  1. 关闭 systemd-resolved ,代理客户端监听在 53 端口。
  2. 代理客户端监听在 1053 端口,劫持 53 到 1053 。
iptables -t nat -N DNS
iptables -t nat -F DNS 
iptables -t nat -A DNS -p udp -j REDIRECT --to-port 1053
iptables -t nat -I OUTPUT -p udp --dport 53 -j DNS
iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to 1053

如果加个劫持端口的选项,在启动 cgproxy 时执行劫持规则,停止 cgproxy 时清空劫持规则,就会方便很多。

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

0 participants