Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
50
votes
7
answers
241729
views
How to edit 'etc/hosts' file in non-rooted phone?
I'm using LineageOS 14.1 and don't want nor need to root it. How can I remount `/system` rw and edit `/system/etc/hosts`? All answers in "https://android.stackexchange.com/questions/60150/how-to-edit-etc-hosts-file" expect a rooted phone.
I'm using LineageOS 14.1 and don't want nor need to root it. How can I remount
/system
rw and edit /system/etc/hosts
?
All answers in "https://android.stackexchange.com/questions/60150/how-to-edit-etc-hosts-file " expect a rooted phone.
berbt
(623 rep)
May 9, 2017, 11:28 AM
• Last activity: Apr 20, 2025, 04:52 PM
6
votes
2
answers
11129
views
How to always resolve a domain name to a fixed IP without rooting?
The financial website `https://wex1.in` got it’s domain name deleted but it’s still possible to reach it by adding `104.25.31.35 wex1.in` to etc/hosts files on a ᴘᴄ. So how to access the website without editing `/etc/hosts`?
The financial website
https://wex1.in
got it’s domain name deleted but it’s still possible to reach it by adding 104.25.31.35 wex1.in
to etc/hosts files on a ᴘᴄ.
So how to access the website without editing /etc/hosts
?
user2284570
(501 rep)
Jan 2, 2019, 05:45 PM
• Last activity: Feb 27, 2025, 12:26 PM
5
votes
2
answers
16823
views
What are all these Google internet hosts (domains) and why is stripped-down Android connecting to all of them?
Technology users are faced with a challenge: Allowing our tech devices to work without them invading our privacy. Obviously choosing products carefully is a critical step. Unfortunately, the two main players in the smartphone space, **Google and Apple**, are well known for their questionable data co...
Technology users are faced with a challenge: Allowing our tech devices to work without them invading our privacy.
Obviously choosing products carefully is a critical step. Unfortunately, the two main players in the smartphone space, **Google and Apple**, are well known for their questionable data collection and harvesting practices.
[LineageOS](https://lineageos.org/) and [/e/OS](https://e.foundation/products/) are *up-and-coming* providers of privacy-friendly smartphone operating systems. Until they become more commonplace, I thought it would be worthwhile to create a compendium of internet hosts to which Android connects by default.
To do this, I let an Android device run for 5 hours and captured all packets trying to leave the device.
The Android device was configured *never* to share contact data, calendar data, task data, map data, location data, or any history of any kind. It also was configured to not transmit or receive email *at all*. The internet search function of the launcher was removed. Furthermore, Google Chrome and the Google's Android Assistant were both disabled, as were all the various "Google Play" apps (such as Google Play Books, Google Play Games, Google Play Movies & TV, Google Play Music / YouTube, Google Play Newsstand) except for the Play store. Within the Google Play store, automatically checking for new app versions was disabled. Finally, a non-Google keyboard was installed and set as the default.
Even after doing all this, within just 5 hours of the phone sitting without being used, the Android device attempted to connect to all the following Google-owned hosts:
history.google.com
mtalk.google.com
alt1-mtalk.google.com
alt2-mtalk.google.com
alt3-mtalk.google.com
alt4-mtalk.google.com
alt5-mtalk.google.com
alt6-mtalk.google.com
alt7-mtalk.google.com
alt8-mtalk.google.com
android.clients.google.com
www.google.com
android.googleapis.com
play.googleapis.com
cloudconfig.googleapis.com
connectivitycheck.gstatic.com
footprints-pa.googleapis.com
mobilemaps.googleapis.com
people-pa.googleapis.com
www.googleapis.com
www.googletagmanager.com
play-lh.googleusercontent.com
smtp.gmail.com
What is the purpose of each of these hosts, and why are so many connections still being attempted given that almost everything Google-related is supposed to be disabled on the device?
Note that I don't expect a single answerer to know the purpose of every host listed, but hopefully we can work together to use this QA to create a quality reference resource.
Amazon Dies In Darkness
(4862 rep)
Jan 26, 2021, 04:07 PM
• Last activity: Dec 4, 2024, 09:08 PM
0
votes
0
answers
234
views
Firewall on an Android hotspot
So my idea for a project is a firewall for Android hotspot. Like on routers you can block access to certain websites, I want to implement it in Android. In settings, system can only limit number of connected users. There aren't advanced options (I'm using Android 13). So if I for example block insta...
So my idea for a project is a firewall for Android hotspot. Like on routers you can block access to certain websites, I want to implement it in Android. In settings, system can only limit number of connected users. There aren't advanced options (I'm using Android 13).
So if I for example block instagram on my firewall, the devices connected to my mobile hotspot won't be able to access it. Like a parental control.
I know I probably must root my phone for this, but it's no problem. The answers I read were old and I didn't find any specific instructions. People recommended using hosts file or iptables but I'm not sure it would work if the request isn't directly from my phone. Downloaded a few blockers but they also fail, or doesn't even have options to do this.
So the main question is, is it possible ? I wanted to ask before I start digging in my phone.
Information I found: https://android.stackexchange.com/questions/214660/is-there-a-way-to-set-up-a-firewall-on-mobile-hotspot-to-block-incoming-connecti
https://www.reddit.com/r/AndroidQuestions/comments/ihjrbv/mobile_hotspot_allow_only_one_website/
How to use iptables in an Android application
https://android.stackexchange.com/questions/144422/create-wifi-hotspot-but-block-access-certain-domains
https://android.stackexchange.com/questions/195351/how-to-block-a-particular-website
https://android.stackexchange.com/questions/149381/how-to-block-filter-sites-on-mobile-data-connection-preferably-using-dns-server/219405#219405
https://android.stackexchange.com/questions/16485/how-to-block-access-to-a-website/218316#218316
szymek349
(1 rep)
Oct 7, 2024, 04:07 PM
0
votes
1
answers
1387
views
How can I change system files to read/write for rooted Android 13 without TWRP?
I recently rooted my OnePlus Nord N30 5G using Magisk, but I still cannot edit the build.prop and hosts files (which was my reason for rooting in the first place). There is no TWRP in the directory for this phone. How can I grant myself read/write permission for these files without needing TWRP? Thi...
I recently rooted my OnePlus Nord N30 5G using Magisk, but I still cannot edit the build.prop and hosts files (which was my reason for rooting in the first place). There is no TWRP in the directory for this phone. How can I grant myself read/write permission for these files without needing TWRP?
This is my first time messing with the OS of an Android phone. I've tried following the instructions in this video: https://www.youtube.com/watch?v=5b_CMft4zlU , but I'm stuck on the very first step (after establishing the connection with adb), since I don't know where to find the systemrw file that he is talking about. Also, I don't trust the link in the description.
I also tried to follow the instructions on https://droidwin.com/how-to-make-system-partition-read-write-on-android/ . On step 10, I do not know what this means, so I don't know how to decide what my "desired" partition size is. I just chose 1 and moved on. However, I am getting stuck around steps 14, as there is another prompt that the instructions don't warn about, creating another backup file. I selected "2" [Recovery/Row] and moved on anyway. From there, I was able to move on to step 19, but here I got stuck since I do not know what the "super.img" file that the article is talking about is, or where to find it.
Dark Malthorp
(101 rep)
Oct 23, 2023, 12:51 AM
• Last activity: Oct 4, 2024, 07:45 PM
23
votes
6
answers
105361
views
How to set up a host to IP mapping on unrooted Android?
I've a website running on my computer, and I want to test it from my Nexus 7 tablet. I.e. over the local WiFi LAN. If I type in the IP address it connects, but shows the wrong web site, because I'm using named virtual hosting. So, what I want to do is be able to type `mysite.local` in to Chrome/Fire...
I've a website running on my computer, and I want to test it from my Nexus 7 tablet. I.e. over the local WiFi LAN. If I type in the IP address it connects, but shows the wrong web site, because I'm using named virtual hosting.
So, what I want to do is be able to type
mysite.local
in to Chrome/Firefox on the Nexus, have them convert that to 10.1.2.3
(or whatever the local IP address is), then call the 10.1.2.3
server giving mysite.local
as the Host to request.
*My Question:* Does an Android 4.x tablet have an /etc/hosts
files, or equivalent, that I can edit? (Without having to root the tablet, or anything like that.)
On my Linux computers I do this by adding an entry in /etc/hosts
:
10.1.2.3 mysite.local
(Or Windows\System32\drivers\etc\hosts
on a Windows machine does the same.)
BTW, this is a semi-duplicate of https://android.stackexchange.com/q/9633/36187 , but that question was for Android 2.2, where apparently it was not possible. (One of the alternative ideas suggested there was configure DNS at the local router, but as far as I can tell my router does not do DNS locally so does not have that option. I could set up my own DNS server to do this, but that feels like a Big Job Solution.)
Darren Cook
(393 rep)
Jul 29, 2014, 08:36 AM
• Last activity: Jun 7, 2024, 03:18 PM
4
votes
1
answers
7839
views
How to modify the "systemless hosts” file under the newer Magisk?
It seems to be under `/system_root/etc` but the `hosts` file really is just a symbolic link to `/system/etc/hosts`. How to modify the "systemless hosts” file under the newer Magisk?
It seems to be under
/system_root/etc
but the hosts
file really is just a symbolic link to /system/etc/hosts
.
How to modify the "systemless hosts” file under the newer Magisk?
Aero Windwalker
(1124 rep)
Jul 27, 2018, 05:45 AM
• Last activity: Jan 22, 2024, 12:09 PM
0
votes
0
answers
2016
views
Is there any way to change hosts file without root?
Is there a method to modify the `hosts` file on an Android device running version 13 without root access? I'm interested in altering `hosts` file to manage network configurations and block certain websites, but I'd prefer not to root my device due to potential security and warranty concerns. Are the...
Is there a method to modify the
hosts
file on an Android device running version 13 without root access?
I'm interested in altering hosts
file to manage network configurations and block certain websites, but I'd prefer not to root my device due to potential security and warranty concerns.
Are there any legitimate and safe procedures, ADB commands, or tools available for achieving this on Android 13?
I couldn't find any way to do that.
almahmud
(1 rep)
Oct 9, 2023, 04:17 PM
• Last activity: Oct 13, 2023, 01:37 AM
0
votes
1
answers
2242
views
root - Can't edit hosts file
I am using Redmi Note 11 running on Custom ROM - `Xiaomi Eu` Specs: [![enter image description here][1]][1] My device is rooted via Magisk. I want to edit the `hosts` file. I have tried using ADB, CX File Explorer, X-Plore Manager but I am unable to edit it. Apparently none of the methods are able t...
I am using Redmi Note 11 running on Custom ROM -
My device is rooted via Magisk. I want to edit the
Xiaomi Eu
Specs:

hosts
file. I have tried using ADB, CX File Explorer, X-Plore Manager but I am unable to edit it.
Apparently none of the methods are able to write on /system
partition because it is Read Only System
.
I looked up online and tried mounting it as writable via ADB using
adb shell
su
mount -o rw,remount /system
Output : /system not in /proc/mounts
And
mount -o rw,remount /
Output : /dev/block/dm-0 is read only
adb root
and disable-verity
aren't working either.
It is so annoying. I had to wait 5 days to unlock the bootloader. Spent whole night installing Custom ROM and rooting my device. And all of it for nothing.
Please help.
Miles Morales
(121 rep)
Jan 12, 2023, 08:36 AM
• Last activity: Jan 28, 2023, 05:19 PM
2
votes
2
answers
24728
views
Where is the "systemless hosts" file under Magisk?
Where is the "systemless hosts" file? I normally just replace the `hosts` file in `/etc/` since I have a customized list. With the systemless hosts, I don't know which file to replace. P.S., for the newer magisk, it is under `/system_root/etc`.
Where is the "systemless hosts" file? I normally just replace the
hosts
file in /etc/
since I have a customized list. With the systemless hosts, I don't know which file to replace.
P.S., for the newer magisk, it is under /system_root/etc
.
Aero Windwalker
(1124 rep)
Mar 22, 2017, 04:49 AM
• Last activity: Jan 12, 2023, 08:48 AM
2
votes
0
answers
110
views
What are all those different localhost domains that apps connect to?
I'm using the Blokada adblocker on my phone, which acts as a vpn and can show me all the domains that apps request to connect to and let me switch them between an accept list and a deny list. Whenever I install an app with known trackers, I try to block as many of those domains as possible while kee...
I'm using the Blokada adblocker on my phone, which acts as a vpn and can show me all the domains that apps request to connect to and let me switch them between an accept list and a deny list. Whenever I install an app with known trackers, I try to block as many of those domains as possible while keeping the base functionality of the app.
I noticed that my log has about a hundred of domains with localhost in the name, many of them not even looking like a url. For example, among some that my phone tried to contact hundreds on times:
localhost_name
localhost0#3}
localhostfo
localhostz\012({
localhostsys
localhost_code
localhostdn.com
localhostgs
localhostsysu
localhostms
localhostal.org
localhostp.net
localhostde
localhostt.com
localhost.com
localhostx.com
localhostahn.de
localhoste.com
localhost=tun0
Some look like actual domain urls accessible on the internet, some not. Some have those weird special characters in them. What are they? Actual domains? Or are they pointing to a webserver running on my phone like normal
localhost
would? Why are there so many of them?
My instinct was to block them on sight because I don't want apps to keep track of my phone connecting to their servers from different IPs, effectively mapping out everywhere I'm going. And I have a hard time trusting a domain name looking like "localhostz\012({". Is there a reason I shouldn't block them?
elyuku
(21 rep)
Aug 19, 2022, 07:45 AM
2
votes
4
answers
5057
views
/etc/hosts file is ignored (android)
I changed my hosts file using ES Explorater after root to 127.0.0.1 youtube.com but it still takes to the real website, I tried on chrome browser and the default browser. I found the same problem on many forums but it didn't help me at all. can any one help me?
I changed my hosts file using ES Explorater after root to
127.0.0.1 youtube.com
but it still takes to the real website, I tried on chrome browser and the default browser. I found the same problem on many forums but it didn't help me at all. can any one help me?
Bashir
(121 rep)
Aug 29, 2016, 01:48 AM
• Last activity: Mar 20, 2022, 08:21 AM
1
votes
1
answers
7074
views
How to access hosts file?
I am following [these instructions][1] to modify the `hosts` file (map IPs to names) and it says it is under `/system/etc`. When I went into my Android file browser, I did not find that directory. Is it because the phone is not rooted and how can I access that file? [1]: https://www.modmy.com/how-mo...
I am following these instructions to modify the
hosts
file (map IPs to names) and it says it is under /system/etc
. When I went into my Android file browser, I did not find that directory. Is it because the phone is not rooted and how can I access that file?
amphibient
(227 rep)
Jan 10, 2022, 11:05 PM
• Last activity: Jan 11, 2022, 06:38 PM
0
votes
1
answers
1154
views
Cannot mount /system rewritable
I have rooted my phone and changed `/system/etc/hosts` file to block Facebook(just for test). However, since I did it, I am not able to edit the `hosts` file again. As a result, I cannot visit Facebook from my phone! I've tried some hosts editors in Google Play but without a result. I've also tried...
I have rooted my phone and changed
/system/etc/hosts
file to block Facebook(just for test).
However, since I did it, I am not able to edit the hosts
file again. As a result, I cannot visit Facebook from my phone! I've tried some hosts editors in Google Play but without a result. I've also tried to mount system rewriteable but it returns error ("Mount: Operation not permitted").
I've already rebooted the device, didn't help. I have no custom recovery installed. I've used Playstore apps that promised doing the remount, but mount -o remount,rw system
has the same issue. The superuser app in place is the one from KingoRoot.
David_David
(21 rep)
Aug 18, 2016, 07:19 AM
• Last activity: Dec 16, 2021, 04:05 AM
47
votes
4
answers
238354
views
How to edit 'etc/hosts' file?
I'm using Nexus 5 on Android 4.4. Kitkat. I would like to edit `/etc/hosts` file and add redirect mappings in order to block few ads. I need to know how to access/modify/replace `/etc/hosts` file. --- I have already checked below similar Q/A: - https://android.stackexchange.com/questions/1957/how-to...
I'm using Nexus 5 on Android 4.4. Kitkat. I would like to edit
/etc/hosts
file and add redirect mappings in order to block few ads.
I need to know how to access/modify/replace /etc/hosts
file.
---
I have already checked below similar Q/A:
- https://android.stackexchange.com/questions/1957/how-to-change-the-hosts-file-to-redirect-urls -> Link in the answer is broken
- https://android.stackexchange.com/questions/16847/guide-to-editing-etc-hosts -> Not found a way to edit hosts file.
Tilak
(725 rep)
Dec 31, 2013, 07:36 AM
• Last activity: Oct 17, 2021, 05:18 PM
0
votes
1
answers
5786
views
YouTube and AdAway whitelist?
I use AdAway to modify my hosts file with quite a few aggressive sources. Unfortunately when my filters are active I can't see any channel or user pictures in the YouTube app. I can't figure out what hostname(s) I need to whitelist to fix this. I've tried using the tcpdump log to add a bunch of Goog...
I use AdAway to modify my hosts file with quite a few aggressive sources. Unfortunately when my filters are active I can't see any channel or user pictures in the YouTube app. I can't figure out what hostname(s) I need to whitelist to fix this.
I've tried using the tcpdump log to add a bunch of Google/YouTube hostnames but this hasn't worked and I don't understand why. Any help would be appreciated.
TheOrionArm
(59 rep)
Jan 11, 2017, 03:49 PM
• Last activity: Jul 1, 2021, 08:26 PM
1
votes
0
answers
608
views
How to block a specific URL phonewide
My first thought was blocking them using AdAway or AFWall, but ironically, an adblock and a firewall are useless Most of the URLs are pictures. I can easily get their URL I ask to block it phonewide because my browser doesn't support custom adblocking Didn't even try adding some lines to the phone H...
My first thought was blocking them using AdAway or AFWall, but ironically, an adblock and a firewall are useless
Most of the URLs are pictures. I can easily get their URL
I ask to block it phonewide because my browser doesn't support custom adblocking
Didn't even try adding some lines to the phone Hosts, because my adblock overwrites it.
- A replacement for the AdAway is very well on the table (if not VPN-based), but for the AfWall, only if it's as lightweight, as well organized, free, and again, not VPN-based
- My browser is Opera. Not changing that.
In case AdAway can be used: If the URL needs to be a line of a host source, how should it be formatted ?
Thank you ahead
user113550
Jun 24, 2021, 09:36 PM
• Last activity: Jun 27, 2021, 03:00 AM
0
votes
0
answers
551
views
Block domain for a specific app
Is it possible to Block domain for a specific app, like to edit host file or via firewall app (have root) to block domain but just to 1 or 2 app?
Is it possible to Block domain for a specific app, like to edit host file or via firewall app (have root) to block domain but just to 1 or 2 app?
Joe
(115 rep)
Jun 25, 2021, 12:45 PM
0
votes
0
answers
707
views
Blocking Reddit on android
I have a habit of using reddit app and I want to kick out this habit. I have tried the following ways to block reddit. 1. Blacklisted this website on a blocker and now cannot access it in any browser. ( BlockerX). 2. Tried blocking many other apps like Boost, Reddit for android, Sync which provide a...
I have a habit of using reddit app and I want to kick out this habit. I have tried the following ways to block reddit.
1. Blacklisted this website on a blocker and now cannot access it in any browser. ( BlockerX).
2. Tried blocking many other apps like Boost, Reddit for android, Sync which provide access to reddit.
Now, the issue is that there are so many other apps available on Play Store to provide access to reddit. It is ineffective and inefficient to block every Reddit app available on Play store.
So, Is there any other way to totally block access to reddit and it's third party apps ?
May be something technical like editing hosts file or build.prop file.
Sudhir Sharma
(151 rep)
Jun 25, 2021, 03:54 AM
1
votes
0
answers
241
views
Block IP/Domain (youtube.com, facebook) and other distracting sites connected via phone's hotspot
Is there a way to block youtube.com and other distracting site like facebook.com when my Laptop is connected via android hotspot at my phone's end i.e. blocking sites via android hosts file. After reading the following techrepublic article, makes me think it's possible but not sure so asking this qu...
Is there a way to block youtube.com and other distracting site like facebook.com when my Laptop is connected via android hotspot at my phone's end i.e. blocking sites via android hosts file. After reading the following techrepublic article, makes me think it's possible but not sure so asking this question.
https://www.techrepublic.com/article/edit-your-rooted-android-hosts-file-to-block-ad-servers/
To edit phones hosts file, android phone must be rooted so I want to be sure before rooting my phone,
If this is not the correct approach then what other options are available.
Thanks
b Tech
(111 rep)
Apr 15, 2021, 08:42 PM
Showing page 1 of 20 total questions