home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


DNS & BIND

DNS & BINDSearch this book
Previous: A.3 Header Section Format Appendix A
DNS Message Format and Resource Records
Next: B. Compiling and Installing BIND on a Sun
 

A.4 Resource Record Data

A.4.1 Data Format

In addition to two- and four-octet integer values, resource record data can contain domain names or character strings .

A.4.1.1 Domain name

(From RFC 1035, page 10)

Domain names in messages are expressed in terms of a sequence of labels. Each label is represented as a one octet length field followed by that number of octets. Since every domain name ends with the null label of the root, a domain name is terminated by a length byte of zero. The high order two bits of every length octet must be zero, and the remaining six bits of the length field limit the label to 63 octets or less.

A.4.1.2 Message compression

(From RFC 1035, page 30)

In order to reduce the size of messages, the domain system utilizes a compression scheme which eliminates the repetition of domain names in a message. In this scheme, an entire domain name or a list of labels at the end of a domain name is replaced with a pointer to a prior occurrence of the same name.

The pointer takes the form of a two octet sequence:

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    | 1  1|                OFFSET                   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

The first two bits are ones. This allows a pointer to be distinguished from a label, since the label must begin with two zero bits because labels are restricted to 63 octets or less. (The 10 and 01 combinations are reserved for future use.) The OFFSET field specifies an offset from the start of the message (i.e., the first octet of the ID field in the domain header). A zero offset specifies the first byte of the ID field, etc.

A.4.1.3 Character string

(From RFC 1035, page 13)

Character string is a single length octet followed by that number of characters. Character string is treated as binary information, and can be up to 256 characters in length (including the length octet).


Previous: A.3 Header Section Format DNS & BIND Next: B. Compiling and Installing BIND on a Sun
A.3 Header Section Format Book Index B. Compiling and Installing BIND on a Sun