Boost iPhone ‘speed’ by using Open DNS on Mobile Data Network

Having an old-yet-trusty iPhone 3G version is really testing my nerve. With the latest 4.2.1, the latest iOS it can support, it only runs like a camel carrying elephant, well maybe I exaggerated. But yes, it is slow.

Opening applications seems like forever, answering a call while an application running is also frustating. The swipe-to-answer mechanism is becoming scratch-to-answer, fells like a monkey finding a bug. But upgrading to iOS 4 was a mandatory thing since more and more appplication can only run on version 4.

Enough said, no more pitty-party, let’s find a fun thing to do on this interesting platform.

DISCLAIMER, this following procedures is for experimental only, I am not responsible for any bad things caused by this experiment.

Let’s see, there are plenty of things to consider when optimizing a system. Defragmenting, processor upgrade, memory upgrade to name a few, none of them are relevant to i device. Well there is one trick that can be done: DNS.

Yes, it might be the only one we can do right now. It’s easy to change DNS settings when using Wifi connection, it only requires changes on the IP setting for that particular connection. But for unknown reason as usual, Apple decided not to include this DNS setting on mobile network.

To complicate the problem, according to Saurik, the guy behind Cydia found here the name-to-IP mechanism on iOS is somewhat different than its *nix brothers. Usually the name server configuration should be placed in /etc/resolv.conf, some variant placed them on /var/resolv.conf but soft-linked to the former. Having proved this myself, created these two files on the iOS filesystem with no luck.

Thanks to this tutorial which tells us that Darwin Kernel in which all of the Apple Operating System derived from, somewhat mysterious on the way they do the name resolving stuff.

Well, if you are having plenty of time to spare you may see those links to study about the behind the scene stories and the mumbo jumbo things surrounding this mystery. But to make things simpler, I’ve created a simple script here that you can try.

#!/bin/sh
state=`echo "list State:/Network/Service/[^/]+/DNS" | scutil | awk '{print $4}'` 

scutil << EOF
get $state
d.add ServerAddresses * 208.67.222.222 208.67.220.220
set $state
show $state
EOF

Make sure that you have mobile terminal handy to run this script as root. Since the Mobile Terminal on the default Cydia repository is not compatible yet with iOS 4, please see here for step by step installing the program on your iPhone.

If you are curious about what this script is doing, it simply find an entry on the Darwin Kernel for the name resolver using ‘list’ command on scutil. The value of the GUID then feeded into scutil again, but for the purpose of changing the name server to Open DNS’ name server.

This script is not persistence, it will replaced by the Operator’s setting if the data connection is restarted. But hey, for the purpose of fun, this one is quite great :)

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>