klzgrad / naiveproxy

Make a fortune quietly
BSD 3-Clause "New" or "Revised" License
6.64k stars 882 forks source link

DNS resolver through DNS address. #302

Closed Doimatcuabautroi closed 2 years ago

Doimatcuabautroi commented 2 years ago

I would like combine Adguard Home + Naive Proxy. May you make transparent DNS request to Adguard Home (ex:127.0.0.1:53) in redirect mode ?

klzgrad commented 2 years ago

It's not painless to set up, but if you have to handle DNS through naiveproxy, I recommend to do this:

A local DNS resolver accepting on UDP on 127.0.0.1:53, and the resolver uses, e.g. 8.8.8.8:53 TCP as upstream. The main thing required from this resolver is to translate UDP DNS query to TCP. The TCP DNS query to 8.8.8.8:53 can be redirected to naiveproxy using iptables, see USAGE.txt to set this up. This UDP to TCP adds about several milliseconds overhead, which is negligible compared to the RTT of a regular UDP DNS query to remote.

Doimatcuabautroi commented 2 years ago

Because my english is bad, so I cant describe exactly what I want to tell you, plus you used too many advanture words >.<

I used naiveproxy in direct mode on WinOS. Because I think naiveproxy is a http(socks) performance proxy, although I dont know what benefits that it brings to me in direct mode. My request is not handle DNS through Naiveproxy, but can it transparents DNS request to Adguard Home when it receives a HTTP(Socks) requests. I hope Naive works like Power Tunnel's Bundled Plugins.

By the way, can naive support http://, I setup 0.0.0.0 for Naive in Lan, some app on my Iphone use http;// protocol, and naive doesnt support it, it's hard for me.

klzgrad commented 2 years ago

Transparent DNS: I assume this means the domain name in a proxy request is resolved remotely. Any SOCKS5 proxy does this by default.

Support http://: No, Naiveproxy doesn't support this. Use privoxy to translate http:// proxy requests to SOCKS5.