Guest kieranc Posted November 20, 2009 Report Posted November 20, 2009 I got a bit sick of all the ads when browsing the web on my phone so I've downloaded the hosts files from mvps.org and put it in /etc/hosts, it's working fine but I've not really tested extensively yet, should make things quicker though I guess! Assuming having a 600k hosts file doesn't slow anything down.... Has anyone else done similar? I saw a port of adblock for the browser but it apparently doesn't compile on new android versions. Is there a better way to do it? it's awesome being able to ssh into my phone... :)
Guest Posted November 20, 2009 Report Posted November 20, 2009 I have no info for you but I'd love a step by step guide to what you're doing!
Guest kieranc Posted November 20, 2009 Report Posted November 20, 2009 I have no info for you but I'd love a step by step guide to what you're doing! well as the phone runs linux it has an /etc/hosts file which is check names against before using DNS to see if it can resolve them locally. if you put an entry in for a certain site pointed to 127.0.0.1 (loopback/localhost address), the site will no longer be reachable, so if you put in the names of all sites which serve advertising, you can block em all... naturally you can't list every single one but we can get a large chunk - I just googled for a pre-made hosts file, there are several about but the highest ranked one was here On the phone /etc is a symlink to /system/etc and /system is mounted read only so once i'd ssh'd in, i remounted /system so it was writable (mount -o remount,rw /system) then it's just a case of putting the new hosts file in place, download it to your sdcard then copy from /sdcard/download to /system/etc or scp it from another machine. I remounted /system ro once i was done, dunno if it'd be done at next boot automatically. When I open the hosts file in vi on the phone it shows a ^M at the end of each line... not sure what that's about, seems to work ok!
Guest Marklm Posted November 23, 2009 Report Posted November 23, 2009 there is a premade app in the market for this! :-) AdFree Android (only rooted phones) well as the phone runs linux it has an /etc/hosts file which is check names against before using DNS to see if it can resolve them locally. if you put an entry in for a certain site pointed to 127.0.0.1 (loopback/localhost address), the site will no longer be reachable, so if you put in the names of all sites which serve advertising, you can block em all... naturally you can't list every single one but we can get a large chunk - I just googled for a pre-made hosts file, there are several about but the highest ranked one was here On the phone /etc is a symlink to /system/etc and /system is mounted read only so once i'd ssh'd in, i remounted /system so it was writable (mount -o remount,rw /system) then it's just a case of putting the new hosts file in place, download it to your sdcard then copy from /sdcard/download to /system/etc or scp it from another machine. I remounted /system ro once i was done, dunno if it'd be done at next boot automatically. When I open the hosts file in vi on the phone it shows a ^M at the end of each line... not sure what that's about, seems to work ok!
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now