FORUMS

PSA: You Can Optimize Your Note 4’s Recents Menu & RAM

The Note 4 never had the fastest Recents Menu, and despite its 3GB of RAM, … more

XDA Picks: Best Apps of the Week (July 25 – Aug 1)

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

Voices Of XDA: Orbiting The Earth With Android

Editor’s note: This week’s feature has been written by forum … more

CloudPlayer: DIY HiFi Music Streaming Solution

In our Helpful Guide to Music Streaming Services, we mentioned several different services … more

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

51 posts
Thanks Meter: 2
 
By DJRepresent, Member on 2nd April 2014, 10:55 PM
Post Reply Subscribe to Thread Email Thread
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
Flag New York, NY
Thanks Meter: 259
 
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: 2
 
More
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
Flag New York, NY
Thanks Meter: 259
 
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: 2
 
More
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
Flag New York, NY
Thanks Meter: 259
 
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 Search this Thread
Search this Thread:

Advanced Search
Display Modes