Block Pop-Up Ads

Edit your hosts file to disable pop-up ads.

Readers

August 17, 2003

2 Min Read
ITPro Today logo in a gray background | ITPro Today

[Editor's Note: Share your security discoveries, comments, problems, solutions, and experiences with products. Email your contributions (500 words or less) to [email protected]. We edit submissions for style, grammar, and length. If we print your submission, you'll get $100.]

If you've been on the Internet lately, you've probably encountered dozens of pop-up ads. Every major Web site has pop-up ads, and most users find the ads annoying. You can disable scripting to get rid of the ads, but doing so might cause problems with other services. Alternatively, you can edit your hosts file to disable the pop-up ads. Editing your hosts file will keep pop-up ads from loading properly and clogging up your system.

Your hosts file's location depends on which version of Windows you're running. In Windows XP, Windows 2000, and Windows NT, the hosts file is in C:winntsystem32drivers. In Windows 9x, the hosts file is in C:windows. Note that the hosts file has no extension; if you save the file with an extension, this workaround will fail.

Open the hosts file and edit it to include the line

127.0.0.1 

where adserver is the server you want to block. The next time a pop-up ad attempts to open, it won't be able to find the server because the server is now pointing at your computer. The message Cannot find host will load in the background rather than the pop-up ad. Editing the hosts file has become so popular that entire Web sites are dedicated to maintaining replacement hosts files. However, you might need to experiment to ensure that blocking a Web site's pop-up ads won't interfere with the site's functionality in case you want to view the Web site. I suggest blocking DoubleClick's and ValueClick's servers, as well as other big offenders.

Using this method will make browsing the Internet easier. In addition, you can use the method in conjunction with your organization's security officer for more advanced purposes, such as preventing spyware functionality.

—Christopher Porter
[email protected]

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like