Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I'm having some problems configuring my local proxy server so that it would restrict access to certain websites.

The proxy server I'm using is Squid; I edited its configuration file found in /etc/squid/squid.conf to include the following:

acl wikipedia dstdomain
http_access deny wikipedia

I tried to redirect elinks to use Squid. According to Squid's config file, it listens to port 3128, so in /etc/elinks/elinks.conf I added the following:

set = "localhost:3128"

I also restarted Squid with sudo /etc/init.d/squid restart, but I can still access the banned websites using Elinks. What did I do wrong?

share|improve this question
Just for clarification, is that your entire configuration ? I can not tell what site you are trying to block and what url you entered into elinks. FWIW, IMO squid works well on a large LAN with several clients, but you need to maintain a blacklist. You can automate the process with SquidGuard. If you have a single client, try an alternate proxy such as privoxy or if you want a graphical option see… . You should also look at "transparent proxies" – bodhi.zazen Dec 17 '11 at 0:42
@bodhi.zazen I edited my examples. Yes, that is all the configuration I did. All I want is to block access to a site and its domains (in this case, Wikipedia). – Paul Dec 17 '11 at 0:48
up vote 2 down vote accepted

I think your syntax is a bit off. Try

acl blacklist dstdomain
http_access deny blacklist

Other options are outlined here:

If you just want to block a single site, you can use /etc/hosts

Or iptables

sudo iptables -A OUTPUT -d -j REJECT --reject-with icmp-host-prohibited
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.