Is there anyway to change DNS settings using NEPacketTunnelProvider?

on iOS 9.0, we can use NEPacketTunnelProvider to create VPN connect, and we can set DNS using NEPacketTunnelNetworkSettings. I'm wondering if there is anyway to change DNS setting without create VPN connect. Such as using a fake VPN server?

How about not assigning any default routes and just setting the DNS servers when you "fake connect"?

Thanks for your response. I tried, but it doesn't work.😐

Accepted Answer

Thanks for your response. I tried, but it doesn't work.

Indeed. This post explains why. It also explains an option you might try. However…

IMPORTANT Your overall goal (using an Network Extension provider to change the DNS without actually providing a VPN service) runs counter to the intended use case for Network Extension providers and I recommend that you not go down this path.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Is there anyway to change DNS settings using NEPacketTunnelProvider?
 
 
Q