iphoneioshosts-file

iPhone: add entry to /etc/hosts without jailbreaking


For my development process I need to access a webserver which is behind a VPN and has no DNS entry. What I was doing on 4.x was to edit /etc/hosts on the iPhone, and add it to the hosts file.

Now I'm on 5.0 beta, and don't want to jailbreak for now just for this purpose.

Is there a way I can add a line to /etc/hosts, just for development purposes (the final, distribution application does not need this hack), without jailbreaking? Can I use other means (declare a fake DNS entry by some unknown means at application launch, for example)?


Solution

  • Set up a real DNS entry, either by setting up a local DNS server on your wireless network, or by using a dynamic DNS service, or by adding an A record to a domain you control DNS for.