Filed Under (Ubuntu) by jonr on May-28-2008

I have used tinydns/djbdns for hosting DNS for quite a while and installed it on a number of previous Ubuntu versions, but installing it on the latest Hardy Heron server edition didn’t go very smoothly. So, I thought I would try and capture my steps for anyone looking to use tinydns on Hardy. Good Luck!

PRE-INSTALL:

  • sudo apt-get install build-essential
  • Add to /etc/apt/sources.list: deb http://ftp2.de.debian.org/debian/ etch main contrib non-free
  • sudo apt-get update

INSTALL ALL THE PACKAGES:

  • ucspi-tcp-src:
    • sudo apt-get install ucspi-tcp-src
    • sudo build-ucspi-tcp
      • Accept all the defaults

  • daemontools
    • sudo apt-get install daemontools-installer
    • sudo build-daemontools
      • Accept all the defaults
    • sudo ln -s /etc/inittab{new} /etc/inittab
  • DJBDNS
    • sudo apt-get install djbdns-installer
    • sudo build-djbdns
      • Accept all the defaults

CONFIG PACKAGES:

  • Create Users (if they aren’t created for you):
    • sudo adduser –no-create-home –disabled-login -shell /bin/false dnscache
    • sudo adduser –no-create-home –disabled-login -shell /bin/false dnslog
    • sudo adduser –no-create-home –disabled-login -shell /bin/false tinydns
  • Configure dnscache:
    • sudo mkdir /var/lib/svscan
    • sudo dnscache-conf dnscache dnslog /var/lib/svscan/dnscache
  • Configure tinydns:
    • sudo tinydns-conf tinydns dnslog /var/lib/svscan/tinydns 10.0.0.105
  • Edit /etc/resolv.conf
    • search revivehosting.com
    • nameserver 127.0.0.1

START-UP CONFIGURATION:

  • INIT:
    • touch /etc/event.d/svscan
    • update contents to:
      • start on runlevel 2
        start on runlevel 3
        start on runlevel 4
        start on runlevel 5
        stop on shutdown
        respawn
        exec /usr/bin/svscanboot
  • sudo /etc/init.d/djbdns restart

Test Install:

  • dnsip www.google.com (dnscache)

References:

  • http://www.troubleshooters.com/linux/djbdns/index.htm
  • http://www.fredshack.com/docs/djbdns.html
  • http://www.howtoforge.com/install-djbdns-nameserver-on-debian-etch
  • http://www.len.ro/work/tools/gutsy-on-a-ubuntu-server/dhcp-and-djbdns
  • http://cr.yp.to/djbdns/run-server.html
  • http://www.fredshack.com/docs/djbdns.html
  • http://www.paralipsis.org/2008/04/configuring-daemontools-under-ubuntu-upstart/
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • DZone
  • Digg
  • del.icio.us
  • Reddit
  • Facebook
  • LinkedIn

Comments:
Marcus Ilgner on July 9th, 2008 at 12:25 pm #

Thanks a lot, that was really helpful!
Only thing to notice is that 10.0.0.105 has to be replaced by the public IP of the nameserver – at first I wasn’t sure if it was that or the IP of the nameserver to forward to.

Joe "Floid" Kanowitz on August 12th, 2008 at 4:15 pm #

Can you explain the inexplicable reference to /etc/inittab{new}?

Bob Wooden on August 28th, 2008 at 10:03 am #

Great simple, straight forward instructions.

When I got to creating users, I was copy and pasting instructions (I find I make fewer typos that way) and the adduser instruction failed with a ONLY ONE OR TWO USERS complaint. Seems the dashes that appear immediately in front of ‘-no-create-home’ and ‘-disabled-login’ are NOT actually dashes. By simply replacing those marks with a true dash (typed by keyboard) addusers worked fine. When you created you page of instructions, some how the dashes got changed.

Other than that minor issue, WORKED GREAT!!!

somebody on September 3rd, 2008 at 10:57 am #

Didn’t work for me.

Do you want to install ucspi-tcp_0.88-10_i386.deb now? [Yn]
(Reading database … 20722 files and directories currently installed.)
Unpacking ucspi-tcp (from ucspi-tcp_0.88-10_i386.deb) …
Adding `diversion of /usr/man/man5/tcp-environ.5.gz to /usr/man/man5/tcp-environ.5q.gz by ucspi-tcp’
dpkg-divert: error checking `/usr/man/man5/tcp-environ.5q.gz’: No such file or directory
dpkg: error processing ucspi-tcp_0.88-10_i386.deb (–install):
subprocess pre-installation script returned error exit status 2
Errors were encountered while processing:
ucspi-tcp_0.88-10_i386.deb

Maybe it’s because I am using ubuntu 8.04.1 server and I don’t have a /usr/man directory, not sure what ubuntu package installs that – seems rather hard to find out. Also have difficulty finding debian’s apt public key – strange they don’t put it in an easy to find place on the web.

Lily on September 27th, 2008 at 8:23 am #

At the end of installing daemontools, after linking /etc/inittab, need to also do: sudo initctl start svscan

svscan wont start until you do this (unless you reboot), making the installations of dnscache and tinydns fail to start.

Otherwise, perfect! Thanks, Lily

Lily on September 28th, 2008 at 7:46 pm #

Interesting. My ucspi-tcp also failed to install, on an Ubuntu server, for the same reason. I didnt realize it until I tried to use tcprules.

I did; sudo ln -s /usr/local/man /usr/man ; sudo mkdir /usr/man/man5

It installed fine then.

Lily

Ubuntu and djbdns — Somewhere out there! on December 30th, 2008 at 12:30 pm #

[...] Tinydns / DJBDNS on Ubuntu Hardy Heron [...]

joel on May 26th, 2009 at 5:43 pm #

I just added “csh -cf ‘/command/svscanboot &’” to /etc/rc.local

Seriously a pain in the ass to install in ubuntu…

Eduardo Romero on October 20th, 2009 at 12:06 am #

I had troubles with this, it wouldn’t start with the error:

Starting djbdns: svc: warning: unable to control /var/lib/svscan/tinydns: file does not exist
svc: warning: unable to control /var/lib/svscan/tinydns/log: file does not exist
tinydns .

I had to edit /usr/bin/svscanboot change the path there from /etc/service to /service, killed svscanboot and it respawned just fine.

/etc/init.d/djbdns start worked after that.

Post a comment
Name: 
Email: 
URL: 
Comments: