Wednesday, July 10, 2013

Setting up opendns.com with Ubuntu 12.04/Mint 13

opendns.com is a great service for blocking and/or tracking web access. Although most people probably have a dynamic ip address, and it can be difficult to find a good way to keep your ip up to date with their site and servers. This is the way I found the easiest for me.

Go to www.opendns.com click on 'Sign In' in the top right corner. Then click on the Get Started! link and set up an account. I would suggest either of the free accounts. The only difference is that the FamilyShield account is preconfigured. I ended up configuring it myself anyway.

Then log in. Go to the Settings tab. Your own ip should be at the very top of the page(above the nav bar). You can use that to add your network. Once you have added your network you can click on your network/ip and set up your filtering preferences.
allowed on this network.
Now the way I chose to set my network up to go through the opendns servers was by configuring the ip addresses of the opendns servers on my router. This can be different depending on your router, mine was very simple. There was a place to specify static dns servers. I just entered the ip's (they can be found on the opendns website at the bottom of the page.) saved the configuration and all my web traffic was now going through the opendns servers.

Once you get to this point, if you try to visit a blocked site it should come up with an opendns site telling you the domain is blocked. If you have a static ip, then at this point you are done. Most of us I would imagine have a dynamic ip and need to set something up so that this will stay updated. I used DNS-O-Matic provided by same people who made opendns

Go to DNS-O-Matic website: http://www.dnsomatic.com/
Since it is an opendns service you don't need to create an account, you can use the one you just created with opendns.
Click on Sign In, use your opendsn username & password.
Click on the 'Add a service' button and select OpenDNS from the drop down list.
It will add the opendns service and then the status will be waiting for confirmation or something similar.

Now is the fun part. I found my preferred method to keep this up to date was by using ddclient. In a terminal type:
sudo apt-get install ddclient
It will then ask you a bunch of questions. I tried to match this as close as possible although, the questions and names for things are slightly different so it doesn't matter too much what you put in there since we will go to the config file and change it anyways.
After it is installed open up with sudo/root priviledges /etc/ddclient.conf in your favorite text editor. For me:
sudo vim /etc/ddclient.conf

and make it look like this.
The only unique change you need are your username and password, everything else you want to match the file in the previous link. Save the file and run: sudo ddclient

Now you can run ddclient every time your ip changes and it will keep everything updated or you can add it as a cron job, I would say once a day would be enough for most any isp. See how here.

No comments:

Post a Comment