AdguardTeam / AdguardForiOS

The most advanced ad blocker for iOS
https://adguard.com/
GNU General Public License v3.0
1.45k stars 203 forks source link

Start using "127.0.0.1" as a DNS server address #1768

Open ameshkov opened 3 years ago

ameshkov commented 3 years ago

Currently, we're using some LAN address for a fake DNS (which is then intercepted).

We could instead run the DNS proxy on 127.0.0.1:53 and avoid all kinds of issues this way: https://github.com/AdguardTeam/AdguardForiOS/issues/1755#issuecomment-852806235

The same way DNSCloak works: https://github.com/s-s/dnscloak/blob/6a7a3bbf91969ab8a93b089f1ffe28da99fa1e36/platforms/ios/DNSCryptAppExt/PacketTunnelProvider.m#L245

sfionov commented 3 years ago

Please enable TCP listener in AGDnsProxy after moving to localhost.

Currently only UDP listener is enabled, and too long replies are truncated if request was without EDNS0. TCP listener can't be implemented easily on PacketTunnel, but can be easily switched on when we move to 127.0.0.1.