• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Corrupt Hosts File?

Hello everyone,

I use an LG Optimus L4 II (e445). I rooted it but then decided I had too much on it and decided to restore to factory settings. It all worked fine. However, when I got to the Google Account sign in page, it gave me the "couldn't establish a reliable connection to the server" error message. I followed every single tutorial I could find online as to how to solve this. None of them worked. Eventually, I re-rooted it (using VRoot) and managed to download an apk of ES file explorer and locate the hosts file. This had one line that shouldn't have been there:

127.234.104.240 android.clients.google.com

From what I can make out, this is the address of google's sign in servers. So somehow (I suspect malware/dodgy rooting program?) my hosts file has been edited to stop me logging into google. Restoring the device does nothing, neither does unrooting/rerooting. When I open up the file in ES (when rooted) and edit out the bad lines, I can't save for some reason- I think the /system folder is write protected.

So I tried to make the /system folder writeable. I used the android sdk to do this (mount -o command) but this did not do anything. I downloaded the mount /system apk and installed that, it did not help either. I tried /pull and /push on the hosts file to edit it and send it back using the apk. I could successfully pull and edit it, but it would not let me push it back. I'm kind of stuck here. I can effectively not use my phone- I can't use most apps and can't download any.

After trying for a few weeks now, I've still had no success. One idea has come to me though- installing a rom. Would downloading a custom ROM change my hosts file? Also, if so, could anyone recommend one that is similar to default android? One last idea that I've got at the moment is sonehow completely wiping the hard drive of the phone and reinstalling androud on it, though I have no idea whether that is even possible, and if so, how to do it. I would really appreciate some help here!

Thanks a lot,
Louis


BTW I copied this from another forum thread that I posted on another website but have not yet gotten a response. It would be great if I could get one here.

(PS I hope I've posted correctly, I'm a n00b to this website )
 
Make sure he hosts file itself isn't read only (check permissions).

BTW, the entry doesn't say "you can't log into Google", it says that if you want android.clients.google.com it's at 127.234.104.240 - no need to waste time looking it up in a DNS server. That's one of the two purposes of the hosts file. (The other purpose is to point any named address you don't want to access to 127.0.0.1, which is your own computer. That's how ad-blocking programs work. And that's about the only address that will block you from a site.)

And if you're unsure of the purpose of the entry, don't delete it, put a hash mark in front of it:

#127.234.104.240 android.clients.google.com

That converts it to a comment, effectively removing it. But if that causes other problems, you can simply remove the hash mark.
 
Make sure he hosts file itself isn't read only (check permissions).

BTW, the entry doesn't say "you can't log into Google", it says that if you want android.clients.google.com it's at 127.234.104.240 - no need to waste time looking it up in a DNS server. That's one of the two purposes of the hosts file. (The other purpose is to point any named address you don't want to access to 127.0.0.1, which is your own computer. That's how ad-blocking programs work. And that's about the only address that will block you from a site.)

And if you're unsure of the purpose of the entry, don't delete it, put a hash mark in front of it:

#127.234.104.240 android.clients.google.com

That converts it to a comment, effectively removing it. But if that causes other problems, you can simply remove the hash mark.


Thanks for that.

How do I check the permissions of a file in android? (ie the hosts file)

Second, I know the purpose of the hosts file. From what I can make out, that entry is making it that whenever that site (android.clients.google.com) is accessed, it automatically redirects it and stops it from loading, which means I cannot log on to google's servers, etc.

As I said before, I cannot edit the file in any way. When I open it up in ES Notepad and put a # or delete the line and then try to save it, it says that there was an error and the file cannot be saved. As far as I can work out, that's just a r/w issue, which I can't solve. Some more assistance would be greatly appreciated.

Thanks again.
 
You need to set /system to rw.

The easiest way is to connect USB to pc (I assume that you used sdk tools for rooting), open a command window to where you have adb and do -

adb remount

If you're familiar with the hosts protocol, maybe you're familiar with vi? If so, get the console on your pc -

adb shell

And work with what you know.

Make a nandroid backup before playing so you don't have to work later.
 
You need to set /system to rw.

The easiest way is to connect USB to pc (I assume that you used sdk tools for rooting), open a command window to where you have adb and do -

adb remount

If you're familiar with the hosts protocol, maybe you're familiar with vi? If so, get the console on your pc -

adb shell

And work with what you know.

Make a nandroid backup before playing so you don't have to work later.

As I stated above, I've already tried remounting the system folder through the adb. Do you have a full command that I could try? I've tried all the ones I coudl find online that should have mounted my system folder for r/w but when I executed them it just told me that I didn't have permission or something.
 
As I stated above, I've already tried remounting the system folder through the adb. Do you have a full command that I could try? I've tried all the ones I coudl find online that should have mounted my system folder for r/w but when I executed them it just told me that I didn't have permission or something.

I apologize for my oversight there. :o

Let's do it in steps.

adb shell

Do you get a console with the $ prompt?

Then if in the console -

su

Does it elevate you to the # prompt?

Be sure to watch your phone to see if it's wanting to confirm your access at either step.

We need those two things right to proceed.
 
I apologize for my oversight there. :o

Let's do it in steps.

adb shell

Do you get a console with the $ prompt?

Then if in the console -

su

Does it elevate you to the # prompt?

Be sure to watch your phone to see if it's wanting to confirm your access at either step.

We need those two things right to proceed.


OK, here's my latest attempt:

open up console in the folder. adb devices

connected my device

adb remount

remount failed: Operation not permitted.

ok, next try:

adb shell

worked, gave me $

su

worked, gave me # prompt. What now?
 
Inside console with # prompt

mount -o remount,rw /system

If that fails -

mount | grep /system

That's a pipe sign btw.

If that fails, you don't have busybox installed, so just issue -

mount

Find the /system line and paste it here.
 
Btw - after performing the -o remount,rw from the # prompt (means you're root user), check to see if it's rw with the mount command.

If it is, check after you exit root.

On mine, it stays rw only as long as I'm logged in as root.
 
Hi Guys! I just figured out how to mount the system root in FX file explorer. Just go to the system root in FX File Explorer (Not ES File Explorer), or navigate to the host file and then press the menu key or the dots in the top of the system (more like the settings) and then click the Mount Read-Write and youre done just modify the host file whenever you want. Dont forget to change the permission of the host file itself. Cheers! :D
 
Last edited:
If you see this "Can’t establish a reliable data connection to the server. This could be a temporary problem or your SIM card may not be provisioned for data services. If it continues, call Customer Care" when adding account in android device...
Don't worry!! This is just because your hosts file is being modified or updated.

Here I will show you how to fix this..

How to do it [root required]:
1.- Root your device (please do this at your own risk)

2.- Editing the host file:-

You will need a proper editor on your device.
Like: Total Commander or Es File Explorer or Root Browser.
Download and Install one of the application for Android... and open it

DOWNLOAD FROM GOOGLE PLAY

3.- Browse with one of the above apps to system/etc/hosts

Long tap on "hosts" > edit file > open with Es file editor

Open etc/hosts and edit the file.

Just put # before 74.125.93.113android.clients.google.com.

4.- SAVED

Edited file should look like this:

127.0.0.1 localhost #74.125.93.113android.clients.google.com

OR

Just type like this:

127.0.0.1 local host

5.- Reboot your device.

7. Once the phone reboots, input your google account information when the phone asks for it.

Done!
 
If you see this "Can’t establish a reliable data connection to the server. This could be a temporary problem or your SIM card may not be provisioned for data services. If it continues, call Customer Care" when adding account in android device...
Don't worry!! This is just because your hosts file is being modified or updated.

Here I will show you how to fix this..

How to do it [root required]:
1.- Root your device (please do this at your own risk)

2.- Editing the host file:-

You will need a proper editor on your device.
Like: Total Commander or Es File Explorer or Root Browser.
Download and Install one of the application for Android... and open it

DOWNLOAD FROM GOOGLE PLAY

3.- Browse with one of the above apps to system/etc/hosts

Long tap on "hosts" > edit file > open with Es file editor

Open etc/hosts and edit the file.

Just put # before 74.125.93.113android.clients.google.com.

4.- SAVED

Edited file should look like this:

127.0.0.1 localhost #74.125.93.113android.clients.google.com

OR

Just type like this:

127.0.0.1 local host

5.- Reboot your device.

7. Once the phone reboots, input your google account information when the phone asks for it.

Done!

Except this doesn't even answer his question, the OP clearly tried this and it didn't work.
 
Hi Guys! I just figured out how to mount the system root in FX file explorer. Just go to the system root in FX File Explorer (Not ES File Explorer), or navigate to the host file and then press the menu key or the dots in the top of the system (more like the settings) and then click the Mount Read-Write and youre done just modify the host file whenever you want. Dont forget to change the permission of the host file itself. Cheers! :D
Perfect, that's the only method that I found to work. Thanks! :)
 
Hi Guys! I just figured out how to mount the system root in FX file explorer. Just go to the system root in FX File Explorer (Not ES File Explorer), or navigate to the host file and then press the menu key or the dots in the top of the system (more like the settings) and then click the Mount Read-Write and youre done just modify the host file whenever you want. Dont forget to change the permission of the host file itself. Cheers! :D
Thanks man you are awesome i tried everything but no use this thing helped man thanks
 
Hello everyone,

I use an LG Optimus L4 II (e445). I rooted it but then decided I had too much on it and decided to restore to factory settings. It all worked fine. However, when I got to the Google Account sign in page, it gave me the "couldn't establish a reliable connection to the server" error message. I followed every single tutorial I could find online as to how to solve this. None of them worked. Eventually, I re-rooted it (using VRoot) and managed to download an apk of ES file explorer and locate the hosts file. This had one line that shouldn't have been there:

127.234.104.240 android.clients.google.com

From what I can make out, this is the address of google's sign in servers. So somehow (I suspect malware/dodgy rooting program?) my hosts file has been edited to stop me logging into google. Restoring the device does nothing, neither does unrooting/rerooting. When I open up the file in ES (when rooted) and edit out the bad lines, I can't save for some reason- I think the /system folder is write protected.

So I tried to make the /system folder writeable. I used the android sdk to do this (mount -o command) but this did not do anything. I downloaded the mount /system apk and installed that, it did not help either. I tried /pull and /push on the hosts file to edit it and send it back using the apk. I could successfully pull and edit it, but it would not let me push it back. I'm kind of stuck here. I can effectively not use my phone- I can't use most apps and can't download any.

After trying for a few weeks now, I've still had no success. One idea has come to me though- installing a rom. Would downloading a custom ROM change my hosts file? Also, if so, could anyone recommend one that is similar to default android? One last idea that I've got at the moment is sonehow completely wiping the hard drive of the phone and reinstalling androud on it, though I have no idea whether that is even possible, and if so, how to do it. I would really appreciate some help here!

Thanks a lot,
Louis


BTW I copied this from another forum thread that I posted on another website but have not yet gotten a response. It would be great if I could get one here.

(PS I hope I've posted correctly, I'm a n00b to this website )
But i cannot click the "host file it just came up w/ "open with"?
 
Perfect, that's the only method that I found to work. Thanks! :)

Hello everyone,

I use an LG Optimus L4 II (e445). I rooted it but then decided I had too much on it and decided to restore to factory settings. It all worked fine. However, when I got to the Google Account sign in page, it gave me the "couldn't establish a reliable connection to the server" error message. I followed every single tutorial I could find online as to how to solve this. None of them worked. Eventually, I re-rooted it (using VRoot) and managed to download an apk of ES file explorer and locate the hosts file. This had one line that shouldn't have been there:

127.234.104.240 android.clients.google.com

From what I can make out, this is the address of google's sign in servers. So somehow (I suspect malware/dodgy rooting program?) my hosts file has been edited to stop me logging into google. Restoring the device does nothing, neither does unrooting/rerooting. When I open up the file in ES (when rooted) and edit out the bad lines, I can't save for some reason- I think the /system folder is write protected.

So I tried to make the /system folder writeable. I used the android sdk to do this (mount -o command) but this did not do anything. I downloaded the mount /system apk and installed that, it did not help either. I tried /pull and /push on the hosts file to edit it and send it back using the apk. I could successfully pull and edit it, but it would not let me push it back. I'm kind of stuck here. I can effectively not use my phone- I can't use most apps and can't download any.

After trying for a few weeks now, I've still had no success. One idea has come to me though- installing a rom. Would downloading a custom ROM change my hosts file? Also, if so, could anyone recommend one that is similar to default android? One last idea that I've got at the moment is sonehow completely wiping the hard drive of the phone and reinstalling androud on it, though I have no idea whether that is even possible, and if so, how to do it. I would really appreciate some help here!

Thanks a lot,
Louis


BTW I copied this from another forum thread that I posted on another website but have not yet gotten a response. It would be great if I could get one here.

(PS I hope I've posted correctly, I'm a n00b to this website )
PM me if something happen :D
I cant click the host file it only came up w/ "open with" :( plss help tnx
 
Back
Top Bottom