Galaxy S6 Weekly Shooting Challenge

Over in our forums this weekend, XDA Forum member DevonSloan has started a thread for talented … more

Which Features from Apple Watch Do You Think Android Wear Will Copy?

The Apple Watch and Android Wear are both growing platforms. Now … more

XDA Picks: Best Apps of the Week (May 15 – 22)

Apps are at the front and center of any smartphone experience, and with over a … more

Android 5.1 for the Nvidia Shield Tablet is Out!

Nvidia is quite good at delivering updates in a timely fashion. The producer of famous … more
Post Reply Subscribe to Thread Email Thread

Where is the Hosts File in Android?

13th May 2009, 01:25 AM |#1  
OP Junior Member
Thanks Meter: 0
In my country some sites have been banned but most of us keep using them in pc's by changing hosts file in \Windows\System32\drivers\etc

adding ip strings like

I just wonder if there is someway to do this in android? If the answer is yes then my new question is "how"...

Thx for the answers...
13th May 2009, 01:44 AM |#2  
Senior Member
Thanks Meter: 29
The Following User Says Thank You to rub1k For This Useful Post: [ View ]
13th May 2009, 02:51 AM |#3  
OP Junior Member
Thanks Meter: 0
Originally Posted by rub1k


Thx. I reached the file by a file manager app. but i cant open it with notepad apps. Do I need the root privilage?
13th May 2009, 03:53 AM |#4  
Retired Recognized Developer
Thanks Meter: 720
yes. Just ADB pull it.
13th May 2009, 03:59 AM |#5  
grokdesigns's Avatar
Senior Member
Flag Chandler, AZ
Thanks Meter: 4
Technically it's in /system/etc/hosts, /etc is a symlink.

If you want to edit it, create a hosts file on your SD card and then cp from terminal with root privileges. Or you could adb push it from your computer.
13th May 2009, 12:47 PM |#6  
OP Junior Member
Thanks Meter: 0
thx a lot for the answers. ill try it.
18th April 2010, 09:07 AM |#7  
Junior Member
Thanks Meter: 0
hello there,

i'm a newbie and i don't know anything about programming. and i need a step by step guide to edit the host file. i have reached the file with file manager but i can't edit or replace it.

18th April 2010, 10:20 AM |#8  
Senior Member
Thanks Meter: 2
Should just be a matter of

adb pull /etc/hosts

Which will copy the file to the current directory, then make the necessary changes, then

adb remount
adb push hosts /etc/hosts

Anyone correct me if I'm wrong. If you don't have ADB set up, now would be a good time to do so; searching for "ADB for dummies" should help you with that.
Last edited by gophergun; 18th April 2010 at 10:22 AM.
18th April 2010, 02:40 PM |#9  
cloverdale's Avatar
Senior Member
Flag Eugene, OR
Thanks Meter: 147
Re: Where is the Hosts File in Android?
I suggest nano if you have a ROM with this included (such as cyanogenmod). Then all you need to do is open the terminal and enter
nano /system/etc/hosts
In this manner, one can do the edits straight from the phone terminal.
18th April 2010, 04:27 PM |#10  
domenukk's Avatar
Senior Member
Thanks Meter: 24
Or download estrongs file manager, go to settings and set file system to "read write"(its in something like root settings or so). after that you can edit the file
Post Reply Subscribe to Thread

ban, ban ip, hosts
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes