How to block porn sites in Ubuntu with OpenDNS

It's been a while folks! I've been busy but, I think I have to share this to you so that you know how easy to block sites especially pornography. And it is without too much configuration like my previous technique. You can even use this technique in Windows, so you don't need to my though journey:

Compiling SquidGuard for Windows (2 days) which really frustrated me => Googling for a better way (1 hour) => I found OpenDNS => Setting up (2 hour)

OK. Let's begin this in Ubuntu Jaunty (It should be OK in other Ubuntu or other Linux distros)

Create OpenDNS account

First, you must create an account. There are 3 steps.

In the first step you must create your personal information. Since I use it home, I choose "household" for "Where will you use this account?" question. Continue to next step.

Change your DNS

  1. In this second step, choose Computer > Ubuntu. Skip instructions from this page. Just read on.
  2. Change your DNS so that your internet access will go through OpenDNS for filtering. To do this you must add the following line into /etc/dhcp3/dhclient.conf

    prepend domain-name-servers 208.67.222.222,208.67.220.220;

  3. Now restart your network by doing: sudo /etc/init.d/networking restart.
  4. Test your configuration by accessing OpenDNS test page. or https://store.opendns.com/settings/

Basic configuration

  1. Go to Settings tab of your dashboard in OpenDNS site.
  2. Fill your current IP in "Add a network" field. You can see your current IP in right top corner. Click "Add this network". Add a network
  3. In the popup window, give this network a name. I typed in Home since I use OpenDNS at home.
  4. If you are using changing or dynamic IP address like me (FastNet), check "Yes, it is dynamic" and you must follow the next step. Label
  5. If your IP address is dynamic, install a package to tell OpenDNS you current IP. I use ddclient since it is easy to use.

    Type: sudo apt-get install ddclient In its installation, just fill fields with anything you like since we will change this through configuration file. After the installation, edit /etc/ddclient.conf file:


    ssl=yes

    use=web, web=whatismyip.org
    pid=/var/run/ddclient.pid
    protocol=dyndns2
    use=if, if=eth1
    server=updates.opendns.com
    login=yourOpenDnsAccountEgIchsan
    password='youPasswordEgMySecret'
    Home
    mail-failure=root
    mail=root
    syslog=yes

    Change eth1 to eth0 in use=if, if=eth1 line if ifconfig command give you eth0.

    Save, and restart ddclient (sudo /etc/init.d/ddclient restart). You should see

It's time to filter

  1. Choose a network to configure. Choose a label
  2. Choose custom for filtering level since we want to choose our own categories. Custom categories
  3. Click "Apply". This should conclude this tutorial.

Happy safe browsing!

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <pre>
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter OPTIONS}...{/syntaxhighlighter} tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.