Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I have a Motorola Atrix.

My country used to block Facebook, so I decided to add its ip to the /etc/hosts file about 3 months ago and it worked in the browser, but the Facebook app did not.

Now my country has unblocked Facebook so I would like to clear my hosts file and use Facebook as normal. However, my phone cannot connect to Facebook normally even after I performed a factory reset. Other devices still work without the modified hosts file.

Also, if I add some test lines to the hosts file such as:

127.0.0.1 localhost
127.0.0.1 test

then try to ping test in a terminal emulator it returns unknown host.

Is my hosts file being ignored? Did I miss something? I have OTA Root Keeper and it seemed to keep root after I did a factory reset. Did it keep something related to networks, too?

share|improve this question
2  
Could you include exactly what you enter to perform your ping test and into which program? If the host file looks like what you provided and a ping of, say facebook.com results in unknown host that would imply that your DNS server is still trying to hide Facebook and that the host file is indeed being observed. If your ping test was of test keep in mind that (at least what I've read is that) you may need to restart your phone after modifying the hosts file. I must admit I haven't actually done this but I have read other reports where some programs actually cache DNS results. –  ctt Apr 6 '12 at 15:42
    
I use Terminal emulator to do that (with root permission) –  Trinh Hoang Nhu May 28 '12 at 14:27
    
I already restart it –  Trinh Hoang Nhu May 28 '12 at 14:28
    
What did you use to edit the hosts file? –  Richard Borcsik May 28 '12 at 16:43
1  
I meant what application on what device (phone/pc) @eldarerathis yes you're correct /etc is actually /system/etc. –  Richard Borcsik May 29 '12 at 20:32
show 6 more comments

2 Answers

Go to the Applications menu in settings -- at least that what I think it's called on Gingerbread, on on ICS it's just Apps -- select the Facebook app and clear the cache as well as the data. Then go to the /Android folder on your SD card and delete anything starting with com.facebook.

Finally, reboot your phone. If your problem was related to the Facebook app it should now be fixed.

share|improve this answer
    
I've already do a factory reset. Did not work at all :( –  Trinh Hoang Nhu Jun 1 '12 at 16:03
    
I didn't even mention a factory reset. In particular, a factory reset doesn't affect the SD card. –  Erik Jun 1 '12 at 18:46
    
Already try, caan not connect to fb services :( –  Trinh Hoang Nhu Jun 2 '12 at 15:48
    
The point is not only facebook app, but I've try fb in browser... Cannot connect either. I just wanto get rid of the host file... –  Trinh Hoang Nhu Nov 29 '12 at 16:27
add comment

Using a root explorer application, navigate to /system/etc and delete anything that is named hosts including any backups, then restart the device.

You may also need to clear the facebook app data as well.

share|improve this answer
    
Tried, not work. I have to unlock bootloader then reinstall OS :( –  Trinh Hoang Nhu Jan 25 '13 at 2:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.