What is the format of the NAME field in the DNS answer section?

J-barnaby asked:

The NAME field is not detailed completely in RFC 1035 section 4.1.3.

I want to understand this field (programmatically) for the ANSWER message type and I searched these resources (datasheet) for that.

I have followed:

  • IETF RFC 2181
  • www.ccs.neu.edu

Have I missed something?

My answer:

The NAME part in a DNS answer section is formatted exactly the same as the QNAME part of the DNS question section.

a domain name represented as a sequence of labels, where each label consists of a length octet followed by that number of octets. The domain name terminates with the zero length octet for the null label of the root. Note that this field may be an odd number of octets; no padding is used.

It is also subject to the compression scheme in section 4.1.4, so in a typical DNS response you’re most likely to see the full name in the question section, and a pointer to it in the answer section.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.