Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does hosts file exist on the iPhone? How to change it? [closed]

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 ?

like image 558
Hoang Pham Avatar asked Jan 08 '10 15:01

Hoang Pham


People also ask

Can I edit hosts file on iPhone?

Jailbreak your iPhone, download iFile, navigate to /etc/ and open the file called hosts in the text viewer. Now you can edit it.

How do I change the hostname on my iPhone?

Go to Settings > General > About > Name. , enter a new name, then tap Done.

What are etc hosts?

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).


Video Answer


1 Answers

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.

like image 105
stubotnik Avatar answered Sep 28 '22 04:09

stubotnik