Installing MaraDNS

Today on ##linux-india at irc.freenode.net people were discussing about DNS and the recent DNS security issue and it’s implications and solutions. So, I decided to try out the test for my ISP’s nameservers, the default nameservers that I use. The test can be found on Kaminsky’s Website.

The test confirmed that my ISP’s nameservers aren’t patched, so I decided to finally configure my dnsmasq finally and again use local DNS servers. But, the dnsmasq configuration is too lengthy and complicated for this purpose. It’s a great software if you want to have a lot of function like tftp boot, dhcp and such. But, in my case I just need a caching DNS server so decided it was either bind which I always use or try maradns, as suggested by someone on the channel.

Since, I have gone with bind in the past I decided to go with maradns, which I heard is easy to configure and is supposedly as secure as djbdns. So maradns it was. I downloaded the latest release from their download page as no binaries are available in arch repos.

So, let’s start with the process, now that you’ve downloaded the binary. This will work, only for linux. Please check the README files and documentation for further details and different platforms.

First untar the downloaded file, in my case the tar.bz2 file

tar xjvf maradns-1.3.07.08.tar.bz2

cd maradns-1.3.07.08

Then run

./configure

make

Now, your binaries have been created and you’re ready to test out the DNS server

Note:-You need to be root henceforth

mv server/maradns /usr/local/sbin

mv tools/duende /usr/local/sbin

mkdir /etc/maradns

touch /etc/mararc

Now open the /etc/mararc file in your favourite text editor and add the following

ipv4_bind_addresses = “127.0.0.1”
chroot_dir = “/etc/maradns”
recursive_acl = “127.0.0.1”

Now start maradns

/usr/local/sbin/maradns

Then test it

dig @127.0.0.1 example.com

If it returns a reply, you’re good to go 🙂 If not, post the errors I will be glad to help out.

Now, try running it in daemon mode

killall maradns

/usr/local/sbin/duedne /usr/local/sbin/maradns

If all is fine till here then we can proceed to actually install maradns.

First cd to the maradns directory, where the source is place then run

make install

Now, we need to add /usr/local/sbin and /usr/local/bin to our PATH variable

add the following to your bashrc

export PATH=$PATH:/usr/local/sbin/:/usr/local/bin

That’s it, you’re done! Your server is ready to run.

TODO :- Find init scripts for starting it at boot time. My distro is arch. If anyone can supply me one I will be thankful.

PS :-

If you want the server to listen to multiple IP’s add them in a comma separated list inside the quotes for ipv4_bind_addresses. Check http://www.maradns.org/tutorial/recursive.html

Lots of nice stuff can be found at http://www.maradns.org/tutorial/tutorial.html

Advertisements

3 comments on “Installing MaraDNS

  1. Yeah, it’s the same one. Let’s see maybe I will put up another small post on whatever little I know about DNS.
    BTW, if you’re installing it on Arch, you can find it on AUR, as I posted on your blog.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s