Basically, I want to make a fake DNS entry for a URL, and force that URL to resolve to a specific IP. Is there a way to do this in iOS that wouldn’t get an app rejected? I can’t seem to find a way to do this (still at square one). Can anyone point me in the right direction (class reference, third party framework, etc)? If not, is there a rule/policy/something else that I’ve overlooked which makes it impossible?
Share
You can not do this officially at the iOS app level because the DNS is set by the OS and you can not modify the entries due to the iOS Sandbox. This means it is not possible if you are creating an app which you’ll submit to the Apple App Store. You could build something within your own app where if you have some browser, you intercept the URL and redirect it but of course this will be local within your app and not when the user uses Mobile Safari or Chrome etc.
If you are creating an app for Jailbroken devices, you could modify the
/etc/hostsfile and add your entry there