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
1  
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
add comment

5 Answers

No.

See this answer on stackoverflow.

share|improve this answer
add comment

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
add comment

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
add comment

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

share|improve this answer
add comment

Hmmm,

Hoping to find an answer here, but not. I am trying to test Active Sync on a new Firewall. Since I do not want to cut-over thousands of devices untested, I wanted to change the hosts. file on a few test devices to make sure that when I cut-over my old to new firewall, it will work as designed.

The easiest way to test would be simply to change the hosts. file on a few devices to verify that everything works through the new firewall.

I will continue my quest to figure out how to change the hosts. file on an IOS device. I understand it is possible by jailbreaking the phone - but I did not want to do this if I did not have to.

Some people have suggested modifying the DNS on a home router - I may move to this solution.

share|improve this answer
2  
you might consider asking a new question –  dwightk Apr 9 at 20:06
    
Hi and welcome to Ask Different. Posting in the answers section is specifically reserved for posting direct answers to the question being asked. The Stack Exchange Q&A format is different from your typical forum, it's not meant for discussion. For more information please see our Help section. Consider deleting this as it will likely continue to attract down votes for not being a a direct answer to the question or improving it to be a direct answer. –  Ian C. Apr 9 at 21:23
add comment

Your Answer

 
discard

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.