zfl9 / dns2tcp

将 dns 查询从 udp 转为 tcp 的实用工具
GNU Affero General Public License v3.0
138 stars 54 forks source link

Added new comand line option -B <address> for binding specified address when connect to DNS server via TCP #15

Closed ku4in closed 4 months ago

ku4in commented 4 months ago

Added a new command line option -B

. This will allow you to configure traffic routing from dns2tsp through the desired network interface. Or even several copies of dns2tsp (listening on different UDP ports or bound to different network interfaces via the -L option) can be launched simultaneously with binding to different interfaces (by their IP addresses), which will allow routing traffic to the same DNS server (e.g. 8.8.8.8) through different network interfaces using the so-called policy-based routing. For these purposes, simply run several copies of the dns2tsp with different and -B
options, where
is the address of the desired network interface. And then use ip route and ip rule commands to route traffic to DNS server as you wish.

zfl9 commented 4 months ago

Compilation failed.

ku4in commented 4 months ago

The requested changes have been made. Please review again.

ku4in commented 4 months ago

The indents have been aligned and unnecessary empty lines have been removed. Please review again.

ku4in commented 4 months ago

Typos have been corrected. Please review again.

zfl9 commented 4 months ago

Ok, I need to test locally to see if it compiles, and other REVIEW comments.

Sorry for the week-long gap in processing this PR, as I've been busy with work lately.

ku4in commented 4 months ago

Thanks for the review! I hope the suggested changes are found useful and added to the project.

zfl9 commented 4 months ago

Merged, thanks.