Block Ads on Surface! :D

Search This thread

TRSHD

Senior Member
Mar 27, 2012
103
12
Montreal
No, Win32 is case-insensitive. It's traditional on Windows to use upper-case, but it doesn't matter.



NTFS is actually capable of behaving in a case-sensitive manner, but Win32 is explicitly case-insensitive. This leads to weirdness if you don't use the Win32 subsystem and create a file whose name differs from another only by case, then try to open them using a Win32 program like Notepad...







Thanks for the info! Now on with trying to figure out why the ip's still aren't blocked in modern apps...
 

Amer28

Senior Member
Mar 16, 2013
119
16
LG V30
Thank you! Trying this now.

One question.

How did you compile the HOSTS file? Did you make your own, or did you use the one from mvps.org?

I've been using this method to block ads for years now, in every single Windows PC I own(ed), I have a modified HOSTS file.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Ok, so disclaimer: this isn't the same as Ad Block, some ads will slip through, and there will probably be IE error messages popping up.

    However, if you despise adverts and are ready to give feedback, this does block many ads.
    So, what we're doing is editing Windows' built-in hosts file to block these addresses at the source.

    First, download the hosts file attached here.
    Then, browse to "C:\Windows\System32\drivers\etc" and rename "hosts" to "hosts.old"
    Then copy and paste the file you downloaded into the folder, making sure there is no file extension (go to View>show/hide file extensions)

    Next, open CMD as admin (start>cmd>right click>run as admin)
    Type "net stop dnscache" and hit enter.
    After a couple minutes that'll finish.
    Type "sc config dnscache start= disabled"

    Reboot your Surface (or other device)

    You're now (mostly) ad-free! Let me know what you think, and what effects this has on page load speed. (negligible to me, but I'm on a high-speed, slow connections would most benefit.) :good:
    2
    Good tip...

    I used the same method as I do on the desktop, I go to :
    http://winhelp2002.mvps.org/hosts.htm

    Scroll down to folder icon and where it says download, tap and hold or right click and save to local disk.
    Then extract and right click or tap and hold the mvps.bat file and run as admin and your done.

    It makes a backup of your original hosts file as HOST.MVP.

    I have never noticed windows defender 'undoing' this unless it just removes a few entries within it.
    1
    HOSTS-file ad blocking is nothing new, but it is a nice trick. However, there are a few problems with the way you suggested doing this:

    1) the HOSTS file on Win8 and WRT is protected by Windows Defender, and attempts to modify the mapping for a number of known domains (some of which, annoyingly, are advertising domains) will fail. You will want to add \Windows\System32\drivers\etc\HOSTS to the Excluded Files in Defender.

    2) Neither disabling DNS caching nor restarting are needed. Just run the following command: "ipconfig /flushdns" (no quotes). This will wipe the current DNS cache. Disabling the caching entirely will actually degrade performance, as your browser (for example) will need to do a DNS lookup every single time it wants to open a connection to a server, which could be dozens of times per click. Windows will use the HOSTS file just fine while the DNS cache is active. I'm not even *sure* you need to flush it, but it won't hurt.

    By the way, for web browsing, a somewhat "nicer" approach to ad-blocking is to use the built-in IE feature of Tracking Protection Lists. You can "get a Tracking Protection List online" and then add EasyList (who also make the most popular block list for AdBlock Plus/AdBlock Edge). Most people don't realize that IE effectively has a built-in ad blocker, and has for a few releases now... Of course, that won't help with ads outside of the browser.
    1
    HOSTS-file ad blocking is nothing new, but it is a nice trick. However, there are a few problems with the way you suggested doing this:

    1) the HOSTS file on Win8 and WRT is protected by Windows Defender, and attempts to modify the mapping for a number of known domains (some of which, annoyingly, are advertising domains) will fail. You will want to add \Windows\System32\drivers\etc\HOSTS to the Excluded Files in Defender.

    2) Neither disabling DNS caching nor restarting are needed. Just run the following command: "ipconfig /flushdns" (no quotes). This will wipe the current DNS cache. Disabling the caching entirely will actually degrade performance, as your browser (for example) will need to do a DNS lookup every single time it wants to open a connection to a server, which could be dozens of times per click. Windows will use the HOSTS file just fine while the DNS cache is active. I'm not even *sure* you need to flush it, but it won't hurt.

    By the way, for web browsing, a somewhat "nicer" approach to ad-blocking is to use the built-in IE feature of Tracking Protection Lists. You can "get a Tracking Protection List online" and then add EasyList (who also make the most popular block list for AdBlock Plus/AdBlock Edge). Most people don't realize that IE effectively has a built-in ad blocker, and has for a few releases now... Of course, that won't help with ads outside of the browser.

    Ah, very interesting. Thanks for the feedback. :)
    1
    On 8.1 Windows Defender does not allow changes in this file - you must remove it from protected files or disable defender (well, IMO it's nonsense on ARM).