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: localhost 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?

  • 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, 2012 at 15:42
  • I use Terminal emulator to do that (with root permission)
    – James
    May 28, 2012 at 14:27
  • I already restart it
    – James
    May 28, 2012 at 14:28
  • What did you use to edit the hosts file?
    – user13391
    May 28, 2012 at 16:43
  • 1
    I meant what application on what device (phone/pc) @eldarerathis yes you're correct /etc is actually /system/etc.
    – user13391
    May 29, 2012 at 20:32

2 Answers 2


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.

  • I've already do a factory reset. Did not work at all :(
    – James
    Jun 1, 2012 at 16:03
  • I didn't even mention a factory reset. In particular, a factory reset doesn't affect the SD card.
    – Nova
    Jun 1, 2012 at 18:46
  • Already try, caan not connect to fb services :(
    – James
    Jun 2, 2012 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...
    – James
    Nov 29, 2012 at 16:27

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.

  • Tried, not work. I have to unlock bootloader then reinstall OS :(
    – James
    Jan 25, 2013 at 2:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .