Sunday, February 25, 2018

Blocks Ads With Windows 10 Hosts File

Some web pages, such as Microsoft's Hotmail, often bring in ads from other domains which slow down use of the online email service. To speed up web browsing, either block the domains with your router, with a custom DNS, or on your PC. If using Microsoft Windows 10, add the domains to the hosts file.

Press Start button and type "notepad":

Right-click to run Notepad as administrator:

In the Notepad application, open the file C:\Windows\System32\drivers\etc\hosts (or %WINDIR%\System32\drivers\etc)
At the bottom of the hosts file, enter lines to avoid the problem domains. Note the typical convention of the first identation is a "tab", and the spaces between the number and the domain name are spaces. The hash "#" indicates a comment.
#       localhost

In the Notepad application, click File -> Save

Unfortunately, the Microsoft Windows hosts file does not support wildcards. You are required to add entries for subdomains. Alternatively, you can run your own DNS service and use dnsmasq, or use a subscription DNS service which provides wildcards.