IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to block ads using the HOSTS file, Guide
demon
post Jun 3 2010, 12:17 AM
Post #1


Capo
*********

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.


WHAT IS THE 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 127.0.0.1 (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 127.0.0.1, 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.


FIND THE HOSTS FILE AND PREPARE THE EDIT

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 EDITING PART

The Hosts file should already contain:

CODE
127.0.0.1       localhost


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

CODE
127.0.0.1       localhost
127.0.0.1       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.

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

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: 30th October 2014 - 02:27 PM

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