Change view to modify the DNS of Android phone

Source: Internet
Author: User
Tags dns2 home screen opendns test

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.