How can I redirect HTTP requests made from an iPad?

Viewed 99299

Since on an iPad we cannot edit the hosts file (without jailbreaking), how can we arbitrarily redirect web traffic to another url?

This would be important for something such as developing a website that uses a Virtual Host configuration where you want to redirect to a development machine.

(This is related to this question: Can I edit an iPad's host file?)

18 Answers

Using custom DNS server on PC can solve this. I'm using and working perfectly.

Check https://technitium.com/dns/ to download custom DNS server. Which is built using .Net technology. After configuring this tool, you need to change DNS setting to custom and set IP of your PC. To avoid changing IP every time when you restart PC, use static IP on PC.

Intro:

An easy- and quick- way to redirect requests to an internal dev site without making tweaks to any particular device's hosts' file would be to create a name:IP mapping in the router to bypass the public DNS.

This solution is tested and known to work producing consistent, correct results. And it avoids all the Devs doing local hacks on their own machines.

Process:

This example uses a MikroTik router running RouterOS, so if using something else, then you'll have to adapt the process according to how your router's menuing is organized.

  1. Create a name:IP mapping for your dev site on the router. Go to the DNS section first and then click Static:

RouterOS DNS Main Menu

  1. Then click > Add New:

DNS Add New Entry

  1. Now create a DNS entry for your Dev site similar to below:

Local Mapping

  1. Finally, set the default Gateway to be the FIRST DNS resolver for your developers so it bypasses the public DNS records for your website:

Set GW to be 1st DNS Resolver

The DNS servers will be interrogated in sequential order, so it's important that the local mapping is referenced before the mapping published publicly in your DNS for your production website that Google knows about.

Conclusion:

Now when you attempt to view the dev website on your iPad, iPhone or other device when connected to the Developer's subnet, you'll be redirected to the DEV website. No changes to any of those devices hosts files need be made to perform your testing and review.

Anyhoo, this is how a networking person would attack the problem.

Related