Welcome Guest ( Log In | Register )

> How to block ads using the HOSTS file, Guide
post Jun 3 2010, 12:17 AM
Post #1


Group: Members
Posts: 1,084
Joined: 29-August 08
From: underworld
Member No.: 42,672

I see that some users are having problems with ads on this site. This is a simple step by step guide on how to block ads by using the Windows Hosts file.


The Hosts file works as an address book for the PC. Whenever the PC is asked to go to an address to get data, the Hosts file is the first place it looks for finding the IP number to that address. When an ad asks your browser to display content from, for example, adserver.com, your PC is first looking in the Hosts file to see if the IP number to adserver.com is there. When the PC does not find adserver.com in the Hosts file, it will ask your ISP (Internet Service Provider) for the IP number to adserver.com.

The internal address to your own PC is always (do not confuse this with your external IP address you got from your ISP). If you add the domain adserver.com in the Hosts file and give it the address, your PC will not be able to connect to adserver.com. This is because your browser is now being directed to your own PC to find adserver.com, where it of course will not find any ads to display.

The domain "adserver.com" was just an example I made up. It seems like this site is getting alot of ads from ad.doubleclick.net so this is the first domain you should block.


1. Locate the Hosts file. On Windows XP the Hosts file should be located in C:\WINDOWS\system32\drivers\etc.
I think it's at the same location on Vista/7 also, but if you don't find it just search for Hosts in C:\WINDOWS. (The Hosts file does not have a file extension, its full name is "Hosts".)

2. Create a backup of the file and rename the backup "Hosts backup [date]". Leave the backup in the same folder. Right click the backup and select Properties, make sure it is write protected.

3. The Hosts file is likely write protected (it should be), so right click it and remove the write protection.

4. Doubleclick Hosts and choose to open it with Notepad.


The Hosts file should already contain:

CODE       localhost

5. In order to block ad.doubleclick.net, add ad.doubleclick.net on a new line. It should look like this:

CODE       localhost       ad.doubleclick.net         # serving ads to igta

Any comments (optional) can be put after a # sign. It can be on a separate line, or on the same line after the domain name like in the example above.

6. Save.

7. Right click Hosts, select Properties and write protect the file again.

The new GTA 5 website. GTA 5 forums.
QUOTE (Marney1 @ Jan 31 2010, 06:37 AM) *

That's for you ^
Use it in your sig or avatar because you are very special.

for being a little bitch
Edited by TF.
Go to the top of the page
+Quote Post

Posts in this topic
- demon   How to block ads using the HOSTS file   Jun 3 2010, 12:17 AM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


Lo-Fi Version Time is now: 1st October 2014 - 10:47 AM

GTA 5 | GTA San Andreas | Red Dead Redemption | GTA 4