I am developing an application that query to the server. In my Mac, I use the hosts file to change the dns to point to a local server within my local area network.
Now I need to test it with my iPhone, the problem is that my iPhone does not recognize that server due to the missing configuration for dns.
On my Mac or Windows, I simply add: 192.168.0.20 http://www.google.com
to the hosts file.
Now how do I let my iPhone know the URL: http://www.google.com
?
Jailbreak your iPhone, download iFile, navigate to /etc/ and open the file called hosts in the text viewer. Now you can edit it.
Go to Settings > General > About > Name. , enter a new name, then tap Done.
The /etc/hosts file contains the Internet Protocol (IP) host names and addresses for the local host and other hosts in the Internet network. This file is used to resolve a name into an address (that is, to translate a host name into its Internet address).
Another option here is to have your iPhone connect via a proxy. Here's an example of how to do it with Fiddler (it's very easy):
http://conceptdev.blogspot.com/2009/01/monitoring-iphone-web-traffic-with.html
In that case any dns lookups your iPhone does will use the hosts file of the machine Fiddler is running on. Note, though, that you must use a name that will be resolved via DNS. example.local
, for instance, will not work. example.xyz
or example.dev
will.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With