AOSP 5.1 ROM Compiled for the Moto E

It’s been a few weeks since the release of Android 5.1 and XDA Senior Member percy_g2 has … more

CutCalc: A Calculator for Mechanical Engineers

Mechanical and mechatronics engineers may want a handy app to calculate data for … more

Google Play Music Customizations – XDA Xposed Tuesday

If Cyanogen Inc. has its way, you won’t be forced into the Google … more

Sony Xperia Z3 Lollipop Framework Ported to CM12

Android 5.0 for Xperia has a unique look and feel. You don’t have to get a Sony … 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
5 posts
Join Date:Joined: May 2009
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: 28
118 posts
Join Date:Joined: Nov 2008
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
5 posts
Join Date:Joined: May 2009
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
854 posts
Join Date:Joined: Jan 2007
yes. Just ADB pull it.
13th May 2009, 03:59 AM |#5  
grokdesigns's Avatar
Senior Member
Flag Chandler, AZ
Thanks Meter: 4
194 posts
Join Date:Joined: Jul 2007
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
5 posts
Join Date:Joined: May 2009
thx a lot for the answers. ill try it.
18th April 2010, 09:07 AM |#7  
Junior Member
Thanks Meter: 0
1 posts
Join Date:Joined: Apr 2010
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
311 posts
Join Date:Joined: Feb 2008
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
1,597 posts
Join Date:Joined: Feb 2009
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
812 posts
Join Date:Joined: Jan 2010
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