Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm following this tutorial: http://groups.drupal.org/node/16862 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.
IN A 12.85.28.217
*.mydev. IN A 12.85.28.217

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
add comment

2 Answers

up vote 2 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          12.85.28.217

you are inadvertently declaring:

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

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
add comment

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
add comment

Your Answer

 
discard

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.