Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have an iPad that needs to be able to connect to a server via its short hostname, e.g. http://app instead of http://app.example.com. The network it connects to assigns it a domain name other than example.com so it doesn't work automatically.

Is there a way to add a hosts entry (/etc/hosts) for that server in iOS, or add the appropriate domain name to the resolver search list without jailbreaking?

share|improve this question
I found a workaround, although not ideal: you can manually add additional search domains per network in wifi settings: techinch.com/2011/02/04/… –  jgor Jul 7 '11 at 21:14
Why not just connect by the IP address and save all of the other rigamarole? –  SaxDaddy Jul 31 '14 at 0:53
@SaxDaddy for instance there are cases where you need more than one local domain simultaneously. –  tinytiger Oct 7 '14 at 17:06
@SaxDaddy because sometimes you get into CORS issues when you access javascript from elsewhere than the domain it was meant to run from. –  frandroid Dec 2 '14 at 17:33

4 Answers 4


See this answer on stackoverflow.

share|improve this answer

No, but as a work-around, you could have your iPad proxy to a Mac on your home LAN and then do the DNS trickery there.

(I'm assuming that you need this ability during debugging/testing, not "everywhere.")

share|improve this answer

In general, editing the Hosts file is a bad solution. I only use it for temporary testing, and always remove any hosts file entry a few minutes after adding it.

You should be using a DNS server of some kind to setup your custom domain, perhaps this is possible with your wifi router, or else you can set up any mac as a DNS server.

As a nice side benefit, having your DNS server on the LAN will make your internet noticeably faster. Most people are using their router as a DNS server and they really are not fast enough to implement DNS properly. It's a good idea to use a fast remote DNS server (which one is best will depend on what city you live in), but having one on your LAN is even better.

You can google for instructions how to setup bind on any mac, it's free. Or you can purchase Lion Server from Apple in the App Store, and download Server Admin Tools to configure bind with a nice GUI (with Lion, unlike Snow Leopard, you have to download Server Admin Tools separately form buying a license for Mac OS X Server. Basically they've separated the advanced server tools out into a separate download from the basic ones).

share|improve this answer

Use Weblock - AdBlock for iOS app to create a redirect rule from http://app to the IP and port you like.

(Only works when on a WIFI network)

share|improve this answer
Took me a little while to figure out how to make this work, but this is a great solution. Thanks! –  Lea Hayes Dec 8 '14 at 18:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.