If you’re looking for a free way to kill ads, using a fake DNS host file is a great solution. This technique takes advantage of the DNS entries on the hosts file where you can set a server’s IP address to point to a dummy address (not the real ad server).
To use this tip, you will need a little background about the hosts file. Make sure to checkout our previous post about the hosts file if you are new to this DNS config file. The HOSTS file is a plain-text file you can create or edit with a text editor like Notepad. The file has no extension; it is named only HOSTS. You’ll find an existing HOSTS file in C:\Windows\System32\Drivers\Etc\HOSTS.
![]()
The technique is called a loopback because it refers back to your local computer, not to the Internet or a network. To use the HOSTS file to block ads, edit the file by adding individual entries for each ad server, with each server using 127.0.0.1 as the IP address.
First identify the address of the ad by browsing the source code of the page. It usually is an address that starts with “ads” followed by a domain name. In the example below, telegraph.co.uk uses ads.telegraph.co.uk as its internal ad server:
For each ad server you find, create a line in your HOSTS file, like this:
127.0.0.1 ads.telegraph.co.uk
So, when you visit a site with ads, your PC looks at the HOSTS file, finds the entry for the ad server, but never visits the ad server because it’s instead redirected to the loopback address. See the example below before and after editing the hosts file:
Notice the “Lose Belly Fat” ad above is not shown anymore after blocking the ad server:
If a page uses ads.domain.com as its ad server, just add it as another entry on the hosts file like below:
127.0.0.1 ads.telegraph.co.uk
127.0.0.1 ads.domain.com
You may use this same technique to block unwanted pages and not just ads.
Ben Carigtan shows you how it’s done!







Be The First To Comment
Please Leave Your Comments Below