Online advertising is an important industry for job creation, but unfortunately there are still many advertising companies that use aggressive (including Windows circumvention tactics) to deliver software bundles and with that all sorts of misleading webpages (think those download buttons!) and annoying and malicious adverts.
For the most part adverts which are not intrusive (this doesn’t include persistent cookies) and or follow you from site to site, are a fact of life and necessary if you want to consume online content without having to pay for it.
Some of my readers might already use ad blocking plugins such as AdBlock, but there is another way to block adverts by editing the Windows ‘hosts’ file. This file is your Windows address book for website domains. Every time you type an website address into your browser, the ‘hosts’ file will log it.
Note: All website domains are translated into IP address’s which then allow you to connect to that website. The ‘hosts’ file can also be used to block any web address from accessing your computer. It’s this blocking feature that I will discuss in this post.
Here is how you can block adverts from appearing in your software and your ad-supported software:
- Open Windows Explorer and Type > C:\Windows\System32\drivers\etc in the task bar
- Double tap ‘hosts’ file and open with Notepad – IMPORTANT: make a backup copy and name it > ‘hosts- original’ before you edit this file.
- You will now see the following IP address information:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
- Note: You can now add individual websites following the machine name which is denoted by the ‘#’ symbol
- Next – add the websites we want to block following the ‘#’ symbol highlighted above in the Notepad ‘hosts’ file i.e.127.0.0.1 blocked site.com *
- The ‘hosts’ file will now search for this domain at the loopback address, but will not be found because the address is actually offline (looping back to your localhost address 127.0.0.1)
- Next – go to host file site www.hosts-file.net click > download from the “Primary” link and extract the host file (this will be over 30Mb) to your desktop – this is endorsed by my friends at Malwarebytes
- Once the extraction is complete you will see ‘BAD HOSTS BEIGN HERE’ – this will list millions of domains that will be blocked
- Next – Click > Save As – navigate to C:\Windows\System32\drivers\etc for the Windows hosts file is located
- Click the dropdown menu next to ‘Save as type’ > All Files, then double-click the file in the ‘etc’ folder called ‘hosts’
- Windows will notify you that there is another ‘hosts’ file – you will need to replace it – this will take some time
Once the ‘hosts’ file has finished populating with the blocked domains, any browser or software program you open, will no longer be able to display those adverts. Hosts-file.net regularly update the hosts file blocked list, so it’s worth visiting the site every month, to download and update your blocked website listing.