Saturday, June 16, 2018

root access - Modifying hosts file does not have any effect


Since I spend too much time on websites such as 9gag.com and the like, I decided to try and block them by modifying the hosts file on my rooted Nexus 5.


So I created a new hosts file using notepad++, which looks like this :


127.0.0.1 board.4chan.org
127.0.0.1 4chan.org
127.0.0.1 9gag.com
127.0.0.1 www.9gag.com
127.0.0.1 www.4chan.org


etc., saved it as a file without extension, and replaced the original "hosts" file found in system/etc with the new file. However, it does not have any effect and I can still access all those websites as easily as before. I'm using Chrome as my browser.


I checked that the new lines are LF and not CR+LF (read somewhere that it could make the hosts file work not properly) and that the file has no extension (File Explorer shows it as a "file", that's all). When I try to edit the hosts file with an app called Hosts Editor, it looks like everything is good and like my device should redirect the websites I'm trying to reach to localhost.


So my question is : why is this not working? What have I done wrong?


Thanks a lot!



Answer



The answer for anyone interested: after seing that I could not access the blocked websites when in incognito mode, I deleted all of Chrome's data (by going to the Application details and hitting "Clear all data" - I supposed that's how it's said in English but I'm not quite sure). Now, the websites are blocked, so everything is fine. I don't know if I'm supposed to delete this question now that I've solved it but maybe it will be useful to someone if they stumble upon it.


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 ...