2

How would I disable DNS filtering in a UIWebView?? I have a website which has to be viewed on a particular wi-fi and has DNS filtering which I want to bypass. Thanx, SebOH.

1 Answer 1

1
+50

This doesn't really have anything to do with UIWebView, but more the type of DNS filtering that your network has in place. There could be tons of ways that the DNS is being filtered.

Here are a few possible methods off of the top of my head:

1. "Dumb Filtering"

In this case, iOS automatically requests the DNS server to be used from the gateway. The gateway can then provide a DNS server that filters requests. This is extremely easy to bypass. By simply going to the WiFi settings and setting the DNS server manually, the phone will no longer ask the gateway for the DNS server and instead use whichever server you specify. (Google is 8.8.8.8)

   

2. "Smart Filtering"

This is where you must get a little creative. In smart filtering, the gateway actually analyzes DNS packets as they're sent, and if it detects a request for a blocked website, it doesn't let the packet through. This can be difficult to bypass. You would have to somehow obtain the IP address registered with a domain name using a different protocol, like HTTP or some custom design. You'd probably need to employ your own server in this method.

Say the user tries to go to twitter.com. In your delegate method (or wherever you load pages from), you could send an HTTP POST request to your server with an unfiltered DNS (assuming the gateway doesn't filter your server's domain), which would then reply with the corresponding IP address for twitter.com. Then, you could navigate the UIWebView directly to the IP address. Something like so:

NSString *api_response = [YourAPI requestIPFromServer:@"http://yourserver.com/api" withDomain:@"twitter.com"];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:api_response]];
[myWebView loadRequest:request];

Hopefully that helps, but this is kind of a vague question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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