Make Calling Your Loved Ones Easier and Cheaper this Diwali

Diwali, or Deepawali as some Indians call it, is the pride and joy of Indian … more

Big Android BBQ 5.0 Recap – XDA TV

This fifth annual Big Android BBQ has come and gone. The speakers have spoke, the sponsors have … more

Microsoft to Counter “OK Google” with Bing Torque

When Microsoft is making apps for Android, users should be aware that something … more

Google Confirms “Android Lollipop Day” for November 3rd

A little over a week ago, Google announced the latest iteration of … more
Post Reply

[Q] Does Android have a "hosts" file?

OP DJRepresent

2nd April 2014, 10:55 PM   |  #1  
OP Member
Thanks Meter: 1
 
32 posts
Join Date:Joined: Apr 2010
I was wondering if Android has a file similar to a windows hosts - a file that manually maps IP addresses to domain names.

Thanks.
3rd April 2014, 03:01 AM   |  #2  
Senior Member
Thanks Meter: 236
 
260 posts
Join Date:Joined: Oct 2012
More
Yes. It's in /system/etc/hosts. -- You'll need to be rooted, and remount /system as read/write to be able to modifiy it.
The Following User Says Thank You to Magamo For This Useful Post: [ View ]
11th April 2014, 09:13 PM   |  #3  
OP Member
Thanks Meter: 1
 
32 posts
Join Date:Joined: Apr 2010
Quote:
Originally Posted by Magamo

Yes. It's in /system/etc/hosts. -- You'll need to be rooted, and remount /system as read/write to be able to modifiy it.

I'm actually following the instructions here:

http://www.howtogeek.com/140576/how-...ock-web-sites/

And it says "failed to copy to /system/etc/hosts: Read-only file system".

Any thoughts?
11th April 2014, 09:22 PM   |  #4  
Senior Member
Thanks Meter: 236
 
260 posts
Join Date:Joined: Oct 2012
More
That howto foolishly leaves out two crucial steps.
adb root
adb remount

Before you try pushing the file back to the phone. As I said, this requires your phone to be rooted, and /system to be remounted as read/write.

Sent from my SGH-T699 using Tapatalk
11th April 2014, 09:50 PM   |  #5  
OP Member
Thanks Meter: 1
 
32 posts
Join Date:Joined: Apr 2010
It worked, but do I need to undo the changes? (ie, unmount, unroot before I disconnect the phone).
11th April 2014, 11:29 PM   |  #6  
Senior Member
Thanks Meter: 236
 
260 posts
Join Date:Joined: Oct 2012
More
You shouldn't need to, however, remounting /system as readonly is not a bad idea, it would prevent malicious apps, unless designed in just such a way from writing there. Worse comes to worse, if you can't figure out how to remount it as ro, you can reboot the phone, and that will do so.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools
Display Modes


Top Threads in Galaxy S Relay 4G Q&A by ThreadRank