I have a rooted android phone where i install an app from outside the play store. and now I cant access play store anymore. I search for solution and found this. But I can't even edit the host file. I use ES file explorer to edit. This are in the host file. localhost

My questions is

  1. How to edit the host file?
  2. What can I delete from the host file?(what are the extra lines apart from default in the host file?)
  • 2
    Did you enable Root option for ES File Explorer? Also, what's the name of the app that deliberately messed up your HOSTS file. It must have requested root access which you granted (blindly).
    – Firelord
    Commented Oct 10, 2015 at 12:51
  • 2
    Could you edit out the link and mention the crux from that link? That link leads to a site which hosts modded APKs (akin to malware many times) so it is best to prevent users from clicking it for nothing but one or two lines of relevant content.
    – Firelord
    Commented Oct 10, 2015 at 13:42
  • 1
    Yes i did enable root option to ES file explorer. @Firelord exactly i grant root access to the app because it is needed to use the app.
    – Puni
    Commented Oct 10, 2015 at 15:29

4 Answers 4


That pretty much looks like the side-loaded app altered your hosts file – and if so, it's malware and I'd get rid of it ASAP – it's completely borked, not even syntactically correct (and looks like a try to redirect playstore access to "nirvana" – as 127.* addresses are reserved for "local loopback"). All but the first line has to be removed.

As your device is rooted, the easiest way to achive that is via adb shell or a terminal app:

mount -o remount,rw /system
echo localhost > /system/etc/hosts
mount -o remount,ro /system

You didn't write why/where ES failed editing the file – I assume you've missed mounting /system read-write before trying that (ES can do that as well).

  • sorry to ask this question. Will it really work ? because I already mess up my nexus 7 tab so I don't want to do it if its not sure
    – Puni
    Commented Oct 10, 2015 at 15:34
  • @Puni I cannot give guarantees here (after all we're talking about computers ;) – but I don't see what should go wrong with that. Two places where it might fail due to implementation, but none that would break anything: If the last step fails (remount r/o), simply reboot. If the first remount (r/w) fails, we need to revert to a little more complicated syntax. The "echo" won't fail. And if the "su" fails, your device isn't rooted :) // Summed up: It won't mess up anything, but very good chances it fixes up things. Estimated chances for success: 99.9%
    – Izzy
    Commented Oct 10, 2015 at 19:22
  • 1
    Thank you. Your answer helps. As you said I can do r/w in ES file explorer , I found a solution through my friend and it is very easy to do, I have posted the answer below. Anyway there might be some other people who may face this problem and doesn't have ES file explorer so your solution is best for all so I am voting up your answer as well as accepting it as the answer.Thank you once again.
    – Puni
    Commented Oct 11, 2015 at 4:39
  • Thanks a lot Puni, also for sharing your own solution (upvoted)!
    – Izzy
    Commented Oct 11, 2015 at 11:15

I got an easy solution from my genius friend here's how.

  1. Go to ES file explorer click menu on the right.
  2. Scroll down to Root Explorer and turn it on, then click again on the Root Explorer it will open up a new menu.
  3. Click mount R/Wit will open a new menu.
  4. Turn on the RW option on for the /system.
  5. Go to the host file /system/etc/hosts and edit the file, then saved.

You can do it by transferring your host file to the pc and by using adb drivers of your mobile you can edit the host file.

  • Connect your device with usb debugging to your pc
  • Open cmd on your PC
  • Write command - adb devices. This command will show your device in cmd.

  • write command for downloading host file from your mobile to PC. - adb pull /system/etc/hosts F:\hosts

  • When you get your host file edit it using notepad.

Source Taken From :


Hope that helps !!

  • 1
    I see two issues in your answer. 1) Why choose "F:"? It may be a DVD drive in some PCs. Best to always detail your answer. 2) You pulled that file but where is the instruction to push it? Also, it is best to mention the need of root access if your answer needs root. There are visitors who never read the question carefully and when the answer doesn't work on their non-rooted device, they post "this answer doesn't work on my device. It give me operation not permitted. blah blah". Please edit.
    – Firelord
    Commented Oct 10, 2015 at 13:03
  • As @Firelord pointed out already, your instructions stop at the most important place: How helpful is an edited hosts file on the F: drive of your computer concerning the non-working apps on the Android device? And, btw, what to edit there? Also there's a gap between steps 3 & 4: if step 3 doesn't show any device, the following steps will fail – what to do in that case?
    – Izzy
    Commented Oct 10, 2015 at 13:35

I've got this solution from the web. What you have to is you need to have a proper root permission for this to work. Just download Hosts editor from the Play store and run it with root permission then just find if there's any hosts entries other than this " localhost" if get any just tick the check boxes of all other hosts entries make sure not to delete this " localhost" then delete those entries by clicking the delete button situated on top right corner and you are good to go. Now just exit the program and run play store.

You must log in to answer this question.

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