改变查看修改安卓手机的DNS
来源:互联网 发布:巨人网络客服中心 编辑:程序博客网 时间:2024/05/27 12:21
This post is a continuation to my previous post on “[How to] Change DNS Server on Android phones?”. The earlier post was about changing the DNS Server when you are connected using WiFi. For a 3G connection, a different set of properties needs to be changed and the way we change 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’ is installed on your machine. In most of the cases, the driver will 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 if you have not done it earlier.
‘rmnet0’ is the interface name for the 3G connection. net.rmnet0.dns1 and net.rmnet0.dns2 are the properties to be changed to point to OpenDNS server. Since, these properties are changed after the connection is established, net.dns1 and net.dns2 also have 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 are proper by visiting http://welcome.opendns.com. Remember, the settings will 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 has interpreters for executing your shell script (in fact, lots of other scripting languages also) from your phone.
Download the wrapper script I have 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 have copied in the above step. All the above steps are needed to be done just once.
Click on the script to launch it. Grant the Super user permission when asked for. You just have to run this script whenever you are connecting to your mobile network.
- 改变查看修改安卓手机的DNS
- 安卓手机修改host
- 安卓手机如何查看已连接的WIFI密码
- adb查看安卓手机上的日志
- 安卓手机怎么查看SIM卡的IMSI串号
- 如何查看安卓手机应用程序创建的数据库
- 安卓手机查看已经连接的WIFI密码
- 如何通过adb修改安卓手机的系统铃声
- 安卓手机分辨率修改工具的使用方法
- 查看 安卓手机wifi密码
- 安卓android手机查看基站信息
- 安卓手机如何查看MAC地址
- 查看安卓手机CPU信息
- adb查看安卓手机日志
- 安卓手机字体修改教程
- 安卓手机优化,修改build.prop
- 安卓手机修改参数工具开发
- 查看与修改网关,DNS
- hdoj 3342 Legal or Not
- Log4j 2之初体验
- solrcloud搭建
- Cookie和是Session
- 极大似然思想原理
- 改变查看修改安卓手机的DNS
- Android TextView中文字通过SpannableString来设置超链接、颜色、字体等属性
- 求两圆相交面积模板
- Codeforces Round #316 (Div. 2) D
- 观察者模式
- PPT自动载入图片并矩阵分布
- 线程池(二)
- Datagrid添加右键菜单
- POJ 2367 Genealogical tree(拓扑排序)