Setting up your own DNS part 1: Getting started

I have been playing with Linux for the last 15 years, but lately I have taken it to a whole new level. On my laptop I have set up a dual boot with Windows XP and Kubuntu, and after almost half a year of running this combination, I am amazed at how few times I have actually booted into Windows XP. Had it not been for the video editing, the second part with Windows XP would not have existed. There are a few other programs I am using under Windows XP, but they are happy to run in VirtualBox without any need for rebooting.

I have had a server in the house on and off over the years, but after moving to Brazil, it became a real need. The server is used for developing websites, testing different installations, caching updates for the workstations in the house, sharing files and sharing our laser printer as well as a number of other small things. It is also a way for me to learn more about networking, Linux servers etc.

Learning is also one of the reasons why I would like to set up a small caching DNS that also resolves the stuff I have on my local network. This task has been a challenge, but with the help of a lot of different online documentation, friends that have given me tips about this and that, I have managed to get it to a point where I can truly say it is working. So I thought I would try to gather the information here, both to help others and for me to remember what I actually have done.

One thing has to be said loud and clear: This server is not exposed on the internet. It sits behind a firewall and is only used by us locally. No ports have been opened up for access from the outside and there is no need to update the rest of the world with the stuff running on our local network.

Before I started, I had to make a few decisions. One of them was that I wanted to use a real domain for this, so I chose to use a subdomain off my domain – . This way, if I ever need to set up a lan at another site, I can simply name it and avoid any conflicts. But for the examples, I have substituted this with so that nobody by accident uses my domain.

Other things I decided on either at the installation of Ubuntu server or before the configuration of the DNS:

Name of server: argoz
IP of server:
IP of gateway:
DNS1: (OpenDNS)
DNS2: (OpenDNS)

There are a few DNS packages to choose from, but I chose to go for bind9 as this seems to be the most common one and it can do everything from small stuff to really big stuff.

Installing it is as easy as typing

sudo apt-get update
sudo apt-get install bind9

on the command line. Follow the prompts, and you have the basic install with a standard configuration. Note that the install has to be done with sodu/root privileges. Either use sudo or become root temporarily.

I will get into the configurations in the other two parts:
Part 2 : Basic configuration

Part 3 : Configuring bind9

The photograph of the phonebook is copyright Egil Sundal and used by permission.'


After living in Norway for over 40 years, I have moved to Brazil. I still sometimes travel to Norway to work, but aim at making those trips shorter and shorter. My worklife has been spent in the professional broadcast area. I have been doing regular production, both recorded and live shows. And I have been working for one of the major suppliers of editing systems, Avid Technology. The last few years I have done a lot of training and teaching. It is a very rewarding kind of work and no two days are the same. I also spend some time hacking together websites and tell people about the benefits of having websites with content management systems - CMS and lately also about the advantages of Linux. My preferred flavour is called Kubuntu.

You may also like...

7 Responses

  1.' Stefan Koch says:

    This looks really, really interesting. It is almost sad that I do not start my exercise-server at the moment. I have been wondering in the past how to do this, but nowadays it is not really needed. Maybe I can use the tutorial once I will work with my VServers again.

    Coming to the question: Would this also work with VServers (I have access to the main server, but there are a lot of VServers running, e.g. for Apache, fileserver, …)? They all have their own IPs in my network, but sometimes there are problems with ports, because I do not totally understand Xen, yet.

    •' Svein says:

      As long as you point each of the virtual servers to the new nameserver and each of them has separate IP addresses I do not see why it would not work. But I do not have any experience with Xen and VServers. So take it with a pinch of salt.

      I am planning to change my own server setup and I am going to use a special version of Ubuntu as the basis – . As a virtual environment, I am planning on using VirtualBox as this is the VM system I am using now and am familiar with. This will allow me to split the different functions so several of them will have their own IP and server. And the DNS will definitely be one of them. VirtualBox also has a built-in VRDP server making it easier to administrate your servers (compatible with the RDP protocol from Microsoft and available in the Remote desktop viewer in KDE).

      One of the things that attracts me to virtualization is that it makes it really easy to move your server(s) to new hardware without needing to change anything in your setup. I will get back with more info about this when I have set it up. In the mean time, if you test it, please come back with your findings!

  1. October 25, 2009

    […] is part 2 of a 3 part series. You should also read part 1 and part […]

  2. October 25, 2009

    […] is part 3 of a 3 part series. You should also read part 1 and part […]

  3. October 25, 2009
  4. October 30, 2009
  5. November 1, 2009

    Story added…

    This story has been submitted to! If you think this story should be read by the free software community, come vote it up and discuss it here: