Is there any api can change DNS server? Change DNS Server from App without going into iPhone wifi settings.
Is there any api can change DNS server?
That would be a security weakness to allow an App to change the DNS used by the device ; it would allow to redirect to a scam DNS with that could be used to intercept your traffic.
So answer must be no with a "normal" device.
On the Mac (since this is the Cocoa forum and not the Cocoa touch one), there is such an API: SystemConfiguration.framework. It requires admin privileges.
e.g.
https://00f.net/2011/08/14/programmatically-changing-network-configuration-on-osx/