How To Filter Web Contents With DansGuardian In Ubuntu

DansGuardian is an open source web content filter which currently runs on Linux systems, including Ubuntu. It allows you to filter content on web pages based on phrases, text and URL. When configured correctly, it will block inappropriate content as well as content not suitable for children.

If you’re looking for a simple content filtering system in Ubuntu, then you may want to take a look at DansGuardian. In this tutorial, I’ll show you how to install and configure DansGuardian in Ubuntu.

 

 

Objectives:

  • Install and configure DansGuardian in Ubuntu
  • Enjoy!

 

To get started, press Ctrl – Alt – T on your keyboard to open Terminal. When it opens, run the commands below to install DansGuardian and Squid.

sudo apt-get install dansguardian squid

dansguardian_oneiric

 

Next, run the commands below to open DansGuardian’s config file.

sudo gedit /etc/dansguardian/dansguardian.conf

dansguardian_oneiric_1

 

Then find the highlighted line shown below and delete it. Or just comment it out by adding the ( # ) before the line. Save when done.

 

dansguardian_oneiric_2

 

Next, run the commands below to open Squid config file

sudo gedit /etc/squid/squid.conf

dansguardian_oneiric_3

 

Then find the line shown below and add the option ( transparent ). Save the file when done.

http_port 3128 transparent

dansguardian_oneiric_4

 

Finally, open Firefox and click ‘Tool –> Preferences –> Advanced –> Network’ and choose Manual proxy configurations. Then add the IP address and port # shown.

127.0.0.1                                  8080

dansguardian_oneiric_5

 

Restart your computer and test it.

 

dansguardian_oneiric_6

 

Enjoy!

 

To start DansGuardian and Squid, run the commands below:

sudo service dansguardian start
sudo service squid start





Loading
  1. jason says:

    Great tutorial – thanks. A couple of things though – firstly a small typo (sudo dansquardian restart) and secondly that the iptables command is one time only and needs scripting for startup (which on 10.04 seems to be the tricky bit!)

  2. solexTZ says:

    great tutorial – i have just configured this on my friends icafe

  3. james says:

    i have a question regarding this,, since we edited the network connection in the browser, isnt it easy enough for the user to disable it? ….

    not unless you have it installed in a ubuntu server right?( with 2 nics )

  4. That's why you configure iptables to redirect all traffic through the proxy, so if someone changes the configuration settings in the browser, they will not be able to connect to anything except reconfigure proxy in the browser.

  5. 3n!Gma says:

    very nice!
    i have a question: how can i use dansguardian to filter and control a windows machine?

  6. dansgaurdian does not work on Windows machines. You probably want to read this post for Windows machines :http://www.liberiangeek.net/2010/03/protect-your-kids-online-with-k9-web-protection-for-free/

  7. kabeza says:

    Hi
    Great tutorial. I'd like to know if I can do this on Ubuntu server (old PC) for having a web filter in a little 10 PC company's lan…I want to block p2p, messengers, p0rn, MU, RS, etc.

    Should I connect the ubuntu to dsl modem, and then make every pc browse through old pc? should I go through an additional guide for doing this? Thanks

  8. It is possible but requires more work. I think this might be a good solution. http://www.liberiangeek.net/2010/04/how-to-setu…

  9. kabeza says:

    Thanks! will give a look

  10. I'm having trouble. When I test it, it's not working. I had to replace 'sudo /etc/init.d/squid restart' with 'sudo service squid restart', but I don't believe that's the problem.

    Any help?

  11. Eric Nelson again. I had to reinstall Ubuntu (enough was going wrong, so I had to reinstall), so I tried again, and it worked.

    Thanks for the excellent walkthrough!

  12. nat says:

    For work on all PC in local network just run on clients:
    sudo iptables -t nat -A OUTPUT -p tcp –dport 80 -j DNAT –to-destination 192.168.1.1:8080

    wher 192.168.1.1 is serwer IP
    for work after reboot add this line (without sudo) in file /etc/rc.local but bifore line: exit 0

  13. panji says:

    hi…
    i’m indonesian…
    can any of you help me how to configure Dansguardian installed on UBUNTU 9.04 and mikrotik router OS running on Virtual box that installed in ubuntu 9.04 in one PC ? please help urgent thanks….






Powered by WordPress | New Free WordPress Themes | Thanks to Business Opportunity, WordPress Themes and Premium WordPress Themes