Early Lollipop Ports for Micromax A116 and A117

It feels like it was only yesterday when Google announced the mysterious Android L.After … more

Now Gesture Tweaks Replaces Google Now with Custom Action

On most modern Android devices with software navigation keys, swiping up from the … more

ToqAN Fixes Android 5.0 Notification Bug on Qualcomm Toq

The Qualcomm Toq is probably one of the lesser known smartwatches on the market … more

How to Root and Unlock the Google Nexus 6 on a Mac – XDA TV

In the past, XDA Developer TV Producer droidmodd3rx has shown you how to … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Where is the Hosts File in Android?

OP saluk

13th May 2009, 02: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

207.200.100.5 shoutcast.com
207.200.100.5 www.shoutcast.com



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, 02:44 AM   |  #2  
Senior Member
Thanks Meter: 25
 
106 posts
Join Date:Joined: Nov 2008
More
/etc/hosts
The Following User Says Thank You to rub1k For This Useful Post: [ View ]
13th May 2009, 03:51 AM   |  #3  
OP Junior Member
Thanks Meter: 0
 
5 posts
Join Date:Joined: May 2009
Quote:
Originally Posted by rub1k

/etc/hosts


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, 04:53 AM   |  #4  
Recognized Developer
Thanks Meter: 719
 
854 posts
Join Date:Joined: Jan 2007
yes. Just ADB pull it.
13th May 2009, 04:59 AM   |  #5  
grokdesigns's Avatar
Senior Member
Flag Chandler, AZ
Thanks Meter: 4
 
194 posts
Join Date:Joined: Jul 2007
More
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, 01:47 PM   |  #6  
OP Junior Member
Thanks Meter: 0
 
5 posts
Join Date:Joined: May 2009
Smile
thx a lot for the answers. ill try it.
18th April 2010, 10:07 AM   |  #7  
Junior Member
Thanks Meter: 0
 
1 posts
Join Date:Joined: Apr 2010
question
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.

thanks.
18th April 2010, 11: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 11:22 AM.
18th April 2010, 03:40 PM   |  #9  
cloverdale's Avatar
Senior Member
Flag Washington DC
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
Code:
 su
nano /system/etc/hosts
In this manner, one can do the edits straight from the phone terminal.
18th April 2010, 05:27 PM   |  #10  
domenukk's Avatar
Senior Member
Thanks Meter: 24
 
809 posts
Join Date:Joined: Jan 2010
More
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

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

Advanced Search
Display Modes