FORUMS

Analysis & Opinion

Top Forum Discussions

Where is the Hosts File in Android?

5 posts
Thanks Meter: 0
 
By saluk, Junior Member on 13th May 2009, 01:25 AM
Post Reply Subscribe to Thread Email Thread
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, 01:44 AM |#2  
Senior Member
Thanks Meter: 29
 
More
/etc/hosts
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
 
More
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, 03:53 AM |#4  
Retired Recognized Developer
Thanks Meter: 720
 
More
yes. Just ADB pull it.
13th May 2009, 03:59 AM |#5  
grokdesigns's Avatar
Senior Member
Flag Chandler, AZ
Thanks Meter: 4
 
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, 12:47 PM |#6  
OP Junior Member
Thanks Meter: 0
 
More
Smile
thx a lot for the answers. ill try it.
18th April 2010, 09:07 AM |#7  
Junior Member
Thanks Meter: 0
 
More
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, 10:20 AM |#8  
Senior Member
Thanks Meter: 2
 
More
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
 
More
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, 04:27 PM |#10  
domenukk's Avatar
Senior Member
Thanks Meter: 24
 
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
18th April 2010, 06:38 PM |#11  
jcarrz1's Avatar
Retired Recognized Developer
Thanks Meter: 1,435
 
More
Quote:
Originally Posted by cloverdale

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.

This guy knows his hosts. I have his file on my desktop and I push it into every rom I use.

Read More
Post Reply Subscribe to Thread

Tags
ban, ban ip, hosts

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes