DNS Message format:
Bits | Name | Description |
0-15 | Identification | Used to match responses to requests. Set by client and returned by server. |
16-31 | Flags | Tells if query or response, type of query, if authoritative answer, if truncated, if recursion desired, and if recursion is available. |
32-47 | Number of questions | |
48-63 | Number of answer RRs | |
64-79 | Number of authority RRs | |
80-95 | Number of additional RRs | |
96-?? | Questions - variable lengths | There can be variable numbers of questions sent. |
??-?? | Answers - variable lengths | Answers are variable numbers of resource records. |
??-?? | Authority - variable lengths | |
??-?? | Additional Information - variable lengths |
Question format includes query name, query type and query class. The query name is the name being looked up. The query class is normally 1 for internet address. The query types are listed in the table below. They include NS, CNAME, A, etc.
The answers, authority and additional information are in resource record (RR) format which contains the following.
- Domain name
- Type - One of the RR codes listed below.
- Class - Normally indicates internet data which is a 1.
- Time to live field - The number of seconds the RR is saved by the client.
- Resource data length specifies the amount of data. The data is dependent on its type such as CNAME, A, NS or others as shown in the table below. If the type is "A" the data is a 4 byte IP address.
Type | RR value | Description |
A | 1 | Host's IP address |
NS | 2 | Host's or domain's name server(s) |
CNAME | 5 | Host's canonical name, host identified by an alias domain name |
PTR | 12 | Host's domain name, host identified by its IP address |
HINFO | 13 | Host information |
MX | 15 | Host's or domain's mail exchanger |
AXFR | 252 | Request for zone transfer |
ANY | 255 | Request for all records |
Usage and file formats
If a domain name is not found when a query is made, the server may search for the name elsewhere and return the information to the requesting workstation, or return the address of a name server that the workstation can query to get more information. There are special servers on the Internet that provide guidance to all name servers. These are known as root name servers. They do not contain all information about every host on the Internet, but they do provide direction as to where domains are located (the IP address of the name server for the uppermost domain a server is requesting). The root name server is the starting point to find any domain on the Internet.
Page 2
< Previous Read More Next >
Page 2
< Previous Read More Next >