running unbound
Everyobody interested enough to read this blog knows what DNS is and why it is important for the internet as we know it. There are many problems with DNS, that are caused by it’s nature of being a distributed system that does not give consistent answers to the same questions everywhere, due to caching, manual intervention or filtering. Some people are even famous for saying, it is the source of all our problems.
The one thing with DNS that bothers me lately more and more is that governments are forcing internet providers to install DNS filters, so that content can be hidden from the (uninformed) general public. Since I am allergic against any form of censorship I started - like so many - switching to other DNS providers, most prominently to googles public DNS. I am just a geek so it had a very high geek appeal to me due to its IP address. It works fine and is right now unfiltered (from what I can tell), but it is yet another thing, that I could actually run myself but use from an entity that I don’t pay for providing me that service.
Therefore I decided to learn a bit more about DNS and set up DNS resolver that is under my control. First I looked into a caching-only configuration of BIND, but then I stumbled upon unbound, wich is described as:
Unbound is a validating, recursive, and caching DNS resolver.
The software is maintained by Nlnet labs, which is a subsidy of the NLnet foundation. If you have never heard of them, they have money and run around to give it to people that want to build something great with it (what’s not to like?).
My current configuration runs on a centos 5.x box (old school, I know) and
it is pretty straight forward to install. First make sure you have the EPEL repository enabled (who
doesn’t?) and then install it with yum -y install unbound.
Once yum has done it’s magic, you can should unbound start by default: chkconfig unbound on.
Not only is the installation straight forward, the configuration is very easy as well.
The configuration file in /etc/unbound/unbound.cfg has an
explanation of all the options and the man pages are excellent as well, however
the minimal thing you have to do, is the following:
In case you have iptables enabled on your server, you have to open port 53
for tcp and udp (see /etc/sysconfig/iptables and
/etc/sysconfig/ip6tables). Now you can simply start
the server with service unbound start and then verify that it works
with something like dig @localhost notes.kel.pe. It should resolve
the name without any problem. Once all of this works, you can try from a remote
host, to verify, that the firewall and access-control settings are correct and
then it’s time to modify your home router, to announce your new server as the
default nameserver in your network.
One of the nice side effects of this setup is that resolved names are cached and everythings goes a bit faster, the other nice thing about it is that your provider can no longer filter the domains you see.
