haxpor / Potatso

Potatso is an iOS client that implements Shadowsocks proxy with the leverage of NetworkExtension framework. ***This project is unmaintained, try taking a look at this fork https://github.com/shadowcoel/shadowcoel instead.
GNU General Public License v3.0
2.04k stars 1.37k forks source link

getSystemDNS Problem on switching networks #10

Open itskeKs opened 7 years ago

itskeKs commented 7 years ago

Hello @haxpor,

so it looks like Potatso (and also your fork) has an issue within the DNS function. It fetches the DNS servers from the system. You can check the code within the packettunnelprovider.m. On network changes, like disconnecting from or connecting to WiFi, this function still gets the saved DNS addresses which it got on the initial start. Lets say you turn on potatso on a network with DNS 127.0.0.1 and in the meantime you connect to X different networks it still be using the first saved DNS, in that case 127.0.0.1. Also iverriding system DNS with hardcoded DNS like the ones from google is not solving that issue. Using custom DNS wont work because of the tun2socks extension which only talks through TCP, it does not support UDP.

Regarding that bug its not possible to use any other App without having a problem!

I am willing to pay soneone who can fix that problem! (either it will restart the tunnel on network changes or the getting system function DNS will work)!

Best,

Chris

x0r2d2 commented 7 years ago

Potatso 1 had/have bug with DNS leak. Developer were informed regarding the problem

itskeKs commented 7 years ago

@hybtoy that means?

x0r2d2 commented 7 years ago

@foguio The bug was fixed in the Potatso 2 which is under beta test in TestFlight

itskeKs commented 7 years ago

@hybtoy is the source somewhere to test it? :| that dns problem is really annoying.

x0r2d2 commented 7 years ago

is the source somewhere to test it?

Already not, unfortunately. Only after release.

x0r2d2 commented 7 years ago

Actually there is no problem with DNS on latest Potatso (Swift 3) that has been built from this repo.

    
haxpor commented 7 years ago

@hybtoy good to know, thanks for this.

itskeKs commented 7 years ago

@hybtoy thats not the actual issue. the problem lies not within safari its within the rest. lets say you connect to wifi at home (dnsfrom touter with 192.168.1.1) and go outside where you loose your wifi the DNS shpuld change but it does not since the tunnel is still established. potatso receives a network change bit eventually uses the same dns which it got within your wifi network. safari will still work (dont ask me why) but the rest of the system does not! the app just try to use the old dns and nothing goes through. even with manually added dns. dont ask me why its also happens.

x0r2d2 commented 7 years ago

@foguio now I got you. I will try to reproduce it and get back to the issue later.

itskeKs commented 7 years ago

i think the problem is within tun2socks. i managed to restart the VPN connection and now i am getting changed dns servers. but on VPN restart the packetprocessor which is tun2socks does not restart. if i try to restart it the whole tunnel crashes. idk ow i can do that.

tuannv19 commented 6 years ago

@hybtoy what's web address u use for check DNS ?

x0r2d2 commented 6 years ago

@tuannv19 whoer.net ipleak.net dnsleaktest.com dnsleak.com