i have a rooted device (Lenovo A3000-h) , and i had this issue of having my hosts file filled every now and then with additional lines (that sometimes blocked me from logging into my google play account) , and i used to manually edit the file and just erase these extra lines (keeping the 127.0.0.1 line intact)
so yea everything was fine till this morning , i tried to access my google play and i couldn't so i tried to edit the hosts file one more time (as usual) but i noticed that the file size became 2.5mb although it has always been less than 0.5mb (170kb-250kb). anyways when i tried to edit it , the file wouldnt open giving me the message (not enough memory)
long story short i deleted the file and i noticed i had a hosts.bak file so i copied it and tried to connect but its taking forever and it's not connecting to the internet anymore.
hint : i took a copy of the file from my friend's "Samsung galaxy mega" phone and still it wouldn't connect
hosts
file is127.0.0.1 localhost
. And of course the file must be world-readable. Try this:echo "127.0.0.1" > hosts && chmod 0644 hosts
while in the directory the file should be in (/system/etc
if I remember correctly – I cannot check at the moment).and i had this issue of having my hosts file filled every now and then with additional lines (that sometimes blocked me from logging into my google play account)
you had a malware in your system that's adding these lines. Resolve that than you wouldn't have to fiddle with your hosts file.