Sep 14

Back on 1.1.4, there was an application called AdBlock that disabled the ads in the iPhone’s Safari browser. This greatly reduced the time it took Safari to render web pages, especially in a situation without wifi. Well, AdBlock still isn’t ported to 2.0, but there is another way to manually disable ads in Safari. It requires SSH or USB access to your phone’s filesystem, but is pretty easy. Read inside for instructions.

First, we want to download the modified hosts file from here. Once the text file is saved to your computer, fire up your SSH client to access your phone. You may also use a USB program such as Total Commander or iPhoneBrowser.

Navigate to /etc/ and rename the “hosts” file that is there to “host.bk” without the quotes. Now, drag the modified hosts text file you downloaded over to your phone. Rename the new hosts file from “hosts.txt” to just “hosts”. Now reboot your phone and enjoy an ad-free Safari!

Note: If you have neutered Apple’s kill switch via BossPrefs, you will need to neuter it again after you’ve completed this process.

Here are some before and after screenshots:



So as you can see, it works great. Leave comments below on how it works for you.

Thanks to James from for this!

\\ tags: , , , ,

10 Responses to “How to block ads in Mobile Safari”

  1. toNYc311 Says:

    Wow this sounds great! I happen to be very good with my iPhone. Is there a way someone can zip this? That way I can just download it with MobileSafari then unzip it in MobileFinder. Use MobileFinder to implement the instructions above. And viola I’m sure it’ll work. I use my iPhone all the time to do SSH type things without the need for SSH or WinSCP. I also use MobileTerminal all the time when need be.

    I don’t have access to a computer most of the time. And I don’t see any other way to get the Host file. I suppose I could wait until tomorrow though. Thanks anyway if there’s a way to get that file with my actual iPhone the way I mentioned above. If not I’ll just do it tomorrow.

    This process sounds sweet!!!

  2. Y3k-Bug Says:

    Just did it, worked like a charm. Thanks for the great tip, this’ll be invaluable when I’m browsing on Edge.

  3. Joe Says:

    …and now every visit to leads you to a phishing site. Did one of you at least check the new hosts file? A very unsafe way to block ads. Sorry!

  4. fuckhead Says:

    i tried it. but ads are still there.

  5. pope23 Says:


    Use wget in MobileTerminal and rename file.

  6. pope23 Says:


    Just use wget within MobileTerminal.

  7. Braden Says:

    Um, no it doesn’t. Ebay on my phone loads fine every time with the new hosts file.

  8. Craig Says:

    Are you saying that a site that looks like ebay but isn’t loads instead? Because if that’s the case then it is very dangerous indeed.

  9. Fabulousray Says:

    Nice!!!! Thanks for the goodwill in the community! Admob ads were starting to annoyme… but not anymore! YES!!!!

  10. Serneum Says:

    Um…if you actually look at the hosts file, all it does is redirect to

    Learn to read the files before accusing them of doing something that they don’t.

Leave a Reply