This post was a continuation to my previous post on "[what to] the change of DNS Server on Android phones?". The earlier post was about changing the DNS Server when you were connected using WiFi. For a 3G connection, a different set of properties needs to be changed and the the-the-the-the-the-the-them is also little different .
Getprop | grep dns-listing the properties with DNS
Method-1 [Manual]
Your device should be rooted. Check out these instructions to root your device with a single-click.
Download and install the latest Android SDK from here. This comes up with all the tools needed for development and testing of your application. Make sure the driver ' ADB interface ' are installed on your machine. In the very most of the cases, the driver would be installed directly once you plug-in the device.
Connect your Android device to your PC on debug mode. Enable USB debugging on your phone. Settings > Applications > Development > USB Debugging.
On your laptop, open a command prompt and enter "adb shell".
Use the command "Getprop | grep DNS "To know all the DNS properties being used. This command requires BusyBox. Please install it earlier.
' Rmnet0 ' is the interface name for the 3G connection. Net.rmnet0.dns1 and Net.rmnet0.dns2 is the properties to being changed to point to OpenDNS server. Since, these properties was changed after the connection was established, NET.DNS1 and Net.dns2 also had to be changed.
Execute these commands as root User:setprop net.rmnet0.dns1 208.67.222.222. SetProp net.rmnet0.dns2 208.67.220.220. SetProp net.dns1 208.67.222.222. SetProp Net.dns2 208.67.220.220
Done. You can test if the settings is proper by visiting http://welcome.opendns.com. Remember, the settings would be applicable only for the current session.
OpenDNS test page sl4a Scripts folder
Method-2 [semi-automated]
If you don ' t want to take the pain of connecting your device to laptop and then changing the settings, try out this method . It uses a wrapper script which executes on your phone.
Download and install Scripting Layer for Android (SL4A). This have interpreters for executing your shell script (in fact, lots of other scripting languages also) from your phone.
Download the wrapper script I has written from here. This wraps all the commands needed for changing, the DNS server in a shell script.
Move the script to/sdcard/sl4a/scripts/. (ADB push change-dns.sh/sdcard/sl4a/scripts/.)
For easy access, add the Scripts folder to your home screen. Long Press on the home screen > Folders > Scripts. Open The Scripts folder and you should see the script ("change-dns.sh") which you has copied in the above step. All the above steps is needed to being done just once.
Click on the script to launch it. Grant the Super user permission when asked for. You just has to run this script whenever your is connecting to your mobile network.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Change view to modify the DNS of Android phone