Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible with the proper firewall rules or proxy setup? For example, when an ad loads, at the bottom you can usually see the domain it is loading itself from. I figure block the major ones in a proxy or firewall and problem solved.

I'd rather see a "Page cannot be displayed" then a poorly crafted ad with no relevance to my internet habits.

share|improve this question
If you search the internet for using the hosts file to block ads you'll find what you want. Basically, the hosts file on the Windows and Linux OS, offer the redirect that you want. Also, various ready-to-use lists are available. – user151227 Dec 12 '12 at 0:44

Privoxy is a proxy that can be used to block ads.

Using the hosts files as vasa1 suggested could also work, but in that case will need one entry for each,, ... , whereas with a proxy or browser plugin (e.g. Adblock Plus) you can typically do things like ads* To some extend this applies to blocking on a firewall level where you will need to find IP addresses or blocks of the ad servers (assuming that it is a real firewall, not application firewall; some application firewall have a content inspection and can filter out ads).

share|improve this answer

Both of those are possible to do and relatively cheaply.

You can block ads in the firewall in DD-WRT (other alternative router firmwares are available) or you can set up a Squid proxy on a server if you have one and have all clients use that.

Luckily you don't have to do too much to get a current list as the makers of easylist/adblockplus make their list available.

How you configure it depends on what resources you have available.

Update May 2016: I'm doing a similar thing using pfSense which is more powerful plus the pfBlockerNG addon which creates a dns 'black hole' that redirects requests for certain domains to a 4x4 pixel transparent GIF based on EasyList and the following additional list sources recommended by the author BBCan177...;showintro=0

I have had to add a few missing ad servers and do some whitelisting for servers I want to allow, but it blocks most domains that host malware and advertising.

share|improve this answer

That is not necessary, but it would be effective. I dont believe firewalls would block directories in a domain like..

instead it would block: the IP of

I strongly suggest you dont try to block ads on a website, ads help site function. If your accessing a website for free there is no reason you can not tolerate a few ads.

However, since i want the best answer here.. Try the adblock extension in Google chrome.

share|improve this answer
The OP specifically asked about blocking advertising at the firewall, and firewalls can block just about anything you want them to including a partial URL. – James Snell Dec 20 '14 at 10:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .