Installing NSD DNS server on your VPS or Dedicated server

Help us grow. Share with your friends!

When it comes to installing DNS server on your linux environment, the most popular and recommended DNS server is BIND DNS server. It does a pretty decent job and statistically speaking, it is installed on quite a majority of systems around the world. The most used may not always be the best in every situation. BIND has a huge variety of customizing options but you may not always need it. We have already looked at how to point your domain to your VPS using BIND and now we will look at an alternative to BIND DNS server.


Another thing I learnt through my experience is that BIND DNS server takes approximately 100 MB of your RAM. If you are running a low end VPS, then it is definitely going to hamper performance in peak traffic time. Using a low end VPS also implies that you may not be doing great tasks on it. In this case you can settle for a simpler options.

NSD is one such name server I came across recently which was quick and easy to install. You can install it and deploy within 15 minutes and it works great. Great thing about NSD is it takes much lesser RAM as compared to BIND.

NSD uses zone files which are exactly similar to BIND. In certain cases you can even use the same zone files from BIND and make your NSD server work. NSD compiles the zone files via “zonec” and creates binary database files with .db extension. This enables fast start up of NSD daemon.

At the time of compiling these zone files, compiler outputs errors which might be causing errors. NSD compiler does not allow the errors to be forwarded to NSD daemon but output them on the console for the user to fix them.

Let us go through the installation steps and get NSD running immediately:

I will be installing NSD on CentOS 6.5. You can install it on any other linux distribution using equivalent commands, the steps remain the same.

After installation, we need to configure the files. All the configuration files are stored in /etc/nsd/ folder in CentOS, whereas they are stored in /etc/nsd3/ in Ubuntu an Debian.


Open the configuration file to add in zone files required to be included at the time of execution.

All you have to do is add a couple of lines at the end of the file.

Now that you have included reference to the .db files, you need to create those files which would contain all the zone information. Do not worry, it is pretty simple!

Here is an example template for the zone file.

Once you have created your zone files, you must compile them using a command and see if it outputs any error,

You should get no errors.

NSD server install

NSD rebuild with no errors!

Now you are done installing NSD DNS server!

This will start NSD daemon and make sure it starts at time of boot.


Salil is an electronics enthusiast working on various RF and Microwave systems. In his free time he writes on the blog, talks over ham radio or builds circuits. He has Yaesu FT2900R VHF transceiver, FT450D HF transceiver and a TYT UV8000E Handheld transceiver.

You may also like...

1 Response

  1. Andrew says:

    Can you please send me the kms activator?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.