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 trying to streamline the addition of DNS records to an NSD install. It looks like it uses the same syntax as BIND so this question may be relevant to either.

It seems like the convention I'm seeing in the current zone file is to separate the SOA, MX, NS, A, CNAME, TXT records into their own stanzas in the zone configuration file, in our case with a semicolon separating one stanza from the next.

I believe this is just for aesthetics and the only real requirement is that the SOA is the first record, the order after that shouldn't matter.

I'm wondering if anyone else has can validate that assumption

share|improve this question
    
That is a really good question which would make for a wonderful little test. I'm interested in both bind and windows dns test results for this. As soon as I get some time I'll set it up and post the results, if nobody beats me to it that is. –  ErikE Nov 22 '13 at 19:04

2 Answers 2

up vote 0 down vote accepted

The order of the resource records (after the mandatory entries) never appeared to functionally matter in any of the dns:es I have come across. When there is a dependency, such as a cname record linking to an a record, this is solved through separating resolution into two queries: one recieving the cname and the other recieving the a record.

As bind and nsd loads the entire zone files into memory at startup, the order does not seem to matter for the resolution performance either.

However, zone file size is a factor both for time to fully load and for query response time: https://www.icann.org/en/about/staff/security/ssr/root-zone-augementation-analysis-17sep09-en.pdf

share|improve this answer
    
Ditto here, I tried both ways with NSD and it works with either. Thanks! –  phealy3330 Nov 22 '13 at 21:48

IIRC RFC 1033 one of the older DNS RFC's (the DNS Wikipedia page has a nice list) states that a SOA record denotes the start of a new zone, but that order of the records in a zone doesn't need to be preserved.

So it's mostly aesthetics and convention. Although tooling may depend on those conventions.

share|improve this answer
    
That's what I'm thinking, According to: zytrax.com/books/dns/ch8 The $TTL directive should be present and appear before the first RR (RFC 2308 implemented in BIND 9). The first Resource Record must be the SOA (Start of Authority) record. Though I haven't read through those RFCs yet to see if they say anything else –  phealy3330 Nov 22 '13 at 19:53
    
I'm thinking that whilst there isn't a functional difference, there might well be a performance penalty for placing a record late rather than early in a large zone file. It was a while since I worked with bind and can't remember how the caching works, i.e. if it loads the whole zone into ram or if it caches by request like windows. For windows dns I'm quite sure it doesn't load everything into ram or the cache would serve no function. –  ErikE Nov 22 '13 at 20:12
    
I doubt bind is written that badly. They likely use a - or are written by programmable challenged people - sort of hashtable / dictionary structure, and do not do a linear search. –  TomTom Nov 22 '13 at 21:03
    
@TomTom I think that's probably correct and that the text file format is parsed and translated into a binary record format –  phealy3330 Nov 22 '13 at 21:07

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.