Home:ALL Converter>How to change/add DNS server for connected WiFi in iOS programmatically?

How to change/add DNS server for connected WiFi in iOS programmatically?

Ask Time:2017-07-11T12:05:57         Author:Asif Raza

Json Formatter

I want to change/add DNS server for connected WiFi of my iPhone device in iOS programmatically?

The Google Public DNS IP addresses (IPv4) are as follows: 8.8.8.8 8.8.4.4

I want to change/add it as like in attached screenshot programmatically.

Please help. I can manage whether its in Objective-c or Swift. It will be more helpful for me in Objective-c. Thanks in advance.

Dummy/Old DNS server of connected Wi-Fi:-

enter image description here

Required DNS server of connected Wi-Fi:-

enter image description here

Author:Asif Raza,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/45025200/how-to-change-add-dns-server-for-connected-wifi-in-ios-programmatically
yy