tags:

views:

67

answers:

2

Hi All,

I like to change DNS address of iPhone through my application. Is it possible ? Any one let me know how i can do it, it will be very helpful. Thanks in advance.

A: 

Unfortunately it's not possible from an app. Oh, and I believe you mean IP address, right?

there was a trick to reset an ip address by turning airplane mode on and off, but the ip address is assigned to you by the network you are connecting to. In the apps you don't have a way to request a "reset" like this. this is done on the system level and not exposed as a method an app can use

Raine
Hi Raine, not IP address but DNS ... I want to change DNS address of iPhone through my APP. Just want to know is there any API available for that. I googled and cant find a solution for this.
iPhoneGuy
I see. This wouldn't be available as an API on the 'unhacked' iPhone, as the carrier is the one who provides the DNS in this case. I have seen this done on a hacked iPhone, however not through an app, but through the settings of the underlying OS. Sidenote, when you are on Wi-Fi, the "local to the network" dns server is the one that is used by the iPhone automatically.
Raine
Thank you very much for your response. :)
iPhoneGuy
+1  A: 

If by DNS address you mean the IP address of the DNS server the iPhone uses for queries to resolve the domain name you provide, then it is not possible in a non-jailbreaked device. The IP address of the DNS server is provided to the iPhone through DHCP. So you would therefore have to change the DHCP settings in the setup of the network you connect to, eg. the Wifi access point.

If you want to change the IP address assigned to the iPhone (and possibly provided to other devices through DNS) then again you would have to modify the DHCP settings on your server. This IP address is provided to the iPhone through DHCP and possibly coordinated with the DNS server in the network.

Claus Broch
DHCP is not the only way to get an IP address and a DNS IP address; there is also BootP and Static assignment.
Laurent Etiemble
@Laurent: true in general, but those doesn't really fit with how the iPhone gets its own IP.
Claus Broch