Tuesday, March 26, 2019

wi fi - Guide to editing /etc/hosts



It was noted in another thread that it should be possible to build up a white list for an android device using the /etc/hosts file. I would like to experiment with this idea. Does anyone have any guidance to offer as to how to go about it?


It has been many years since I played with that area of networking, but from what I remember the host file allows you to specify an IP for an URL which overrides the published DNS settings. With that it is fairly easy to build a list of content that I want to have accessible, or explicitly blocked, but I am not sure how that helps prevent access to other content. I am not aware of, and so far google has not showed me, any way to tell the host file to intercept all other requests. Does android support some form of wild card in the hosts file? Or is there some way to disable DNS regardless of the active network connection?


Should note that the devices I am worried about at the moment are wi-fi only tables running android 2.3.3. I am willing to root them if necessary.



Answer



/etc/hosts doesn't allow wildcards (see here: https://serverfault.com/questions/118378/in-my-etc-hosts-file-on-linux-osx-how-do-i-do-a-wildcard-subdomain).


Two more links about /etc/hosts:



No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...