Welcome To Our Project DNS

DNS Message Format

DNS Message Format

 

All communications inside the domain protocol are carried in a single format called a message. The top-level format of the message is divided into five sections, shown here:  

 

 

 

IDENTIFICATION

FLAGS

 

NUMBER OF QUESTIONS

NUMBER OF ANSVER RRs

Header  12 bytes

NUMBER OF AUTHORITY RRs

NUMBER OF ADDITIONAL RRs

 

QUESTIONS

 

ANSWERS

 

AUTHORITY

 

ADDITIONAL INFORMATION

 

0----------------------------------15-16------------------------------31

Fig. 3   DNS message format

1. HEADER SECTION:

 

  •   IDENTIFICATION: is set by the client and returned by the server. 

 

  The 16-bit PARAMETER consists of:

Bit

Meaning

0

Operation: 0 = Query, 1 = Response

1-4

Query type: 0 = Standard, 1 = Inverse, 2 = server status request.

5

Set if answer authoritative

6

Set if message truncated

7

Set if recursion desired

8

Set if recursion available

9-11

Reserved

12-15

Response type: 0 = No error, 1 = Format error, 2 = Server Failure, 3 = Name does not exit

  •     NUMBER OF ....: give each a count of entries in the corresponding sections in the message.

2. QUESTION SECTION

 

Contains queries for which answers are desired. The client fills in only the question section; the server returns the question and answers with its response. Each question has Query Domain Name followed by Query Type and Query Class fields.

3. ANSWER, AUTHORITY, ADDITIONAL INFORMATION

 

Sections consist of a set of resource records that describe domain names and mappings. Each resource record describes one name.