SHARE

How to Edit the Hosts File on Android

The easiest way to edit the hosts file on your device is to use the Android Debug Bridge, so go ahead and set it up. Once you’re done, navigate into the folder where ADB is located and type cmd into the location bar, which will open a command prompt in the current folder.

image

Once the command prompt opens run the following command to see what devices are attached to your PC.

adb devices

image

Next you need to download the host file from your device so you can edit it.

adb pull /system/etc/hosts F:\hosts

image

Then navigate to where you saved the file and open it with notepad.

image

Now comes the fun part: adding the host entries. Really, you can do anything you want for example, you can use your host file to block ads from appearing on websites instead of using an app like AdBlocker, or in our case we can just block a website like FaceBook by redirecting it to localhost – you will have to search around to get the exact domains to block. When you’re done adding the entries don’t forget to save the file.

image

Finally you will need ADB to push the file back to your device.

adb push F:\hosts /system/etc/

image

That’s all there is to it. Now I can’t browse to Facebook from my device.

Screenshot_2013-03-11-20-19-34

SHARE
Previous articleBest apps for your new Android phones
Next articleHow to disable Cinavia removal “convert video to audio”?
Technewborn is a leading problogging platform that covers the latest in technology, news, social media, mobile industry, apps, games, and more. I have been researching, writing, reading, living in it since 2009. I try adding a unique taste to whatever techy I write. You can follow me on below Social Network

LEAVE A REPLY