Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm following this tutorial: to setup sub-domain on my ubuntu machine. In step III, I use the same db.mydev as the tutorial except the IP:

mydev. 86400 IN SOA mydev. hostmaster.mydev. (
        20091028 ; serial yyyy-mm-dd
        10800; refresh every 15 min
        3600; retry every hour
        3600000; expire after 1 month +
        86400 ); min ttl of 1 day
IN NS mydev. 
IN MX 10 mydev.
*.mydev. IN A

However, when I use named-checkzone mydev db.mydev to check the syntax, I get the error message: zone mydev/IN: has no NS records. Any hints?

share|improve this question
This one is very helpful post. keep on doing a good work guys i also recommend using the combination of these 2 guides: How To Configure BIND as a private-network-dns-server-on-ubuntu Troubleshooting BIND dns on Ubuntu – user273117 Feb 24 '15 at 21:54
up vote 3 down vote accepted

I agree with Andrew B, except that for readability purposes I would not recommend using only whitespace there. Use the @ symbol or the fully qualified name of the zone ("mydev.") in that spot to make things significantly more readable. Disk space is no longer expensive and saving a few characters at the expense of having a file where you don't understand what the zone parser is doing is not a win.

To explain a little further, each resource record declaration consists of a label, a ttl, a class, a type, and a value. But you can leave out any of those except the value and they will be inherited from above.

The snippet you have posted is trying to declare records with name "mydev." for records of class IN and type SOA, NS, MX, and A, but because you've left out important whitespace at the beginning of the lines for the NS, MX, and A record declarations you're running into problems.

If the items surrounded in square brackets are inherited defaults, instead of:

[mydev.]   IN    NS         mydev.
[mydev.]   IN    MX   10    mydev.
[mydev.]   IN    A

you are inadvertently declaring:

IN.[mydev.]   [IN]   NS         mydev.
IN.[mydev.]   [IN]   MX   10    mydev.
IN.[mydev.]   [IN]   A

and as a result no NS record is ever declared for plain old:

mydev.   IN   NS   mydev.

resulting in the error message you are seeing, "zone mydev/IN: has no NS records"

share|improve this answer
This is one of those things you can search for for days and weeks! Thanks for clearing this up! 10 years back this wasn't and issue if i remember well. – Digital Human Nov 15 '14 at 8:27

You need at least one character of whitespace or a tab (credit: @mdpc's edit for the tab reminder) at the start of every line that begins with the "IN". Some administrators are not partial to tabs: in such cases you should try to keep all of these entries aligned with equal whitespace where possible to do so.

This is because you are technically leaving out the first field of the records that you're defining. It's a shortcut for not having to put "mydev." or "@" at the start of every one of those lines, but it only works if you begin the line with with something that isn't record data.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.