A DNS response carries answers as typed records. This lesson decodes an A answer down to its exact address bytes.

highlighted = computed this step

Why an answer is a record

A DNS answer is a typed record, not just a loose address. The strip shows the type, class, data length, and address bytes.

RDLENGTH=4\text{RDLENGTH}=4
A answerThe DNS answer record is decoded from exact fields.A answer80 bits / 10 bytes0x0001000100045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000001000101110110111000byte 8byte 91101100000100010type0x0001class0x0001rdlength4rdata93.184.216.34(cont.)

Type, class, and length

The answer type is 1 for A, the class is 1 for IN, and RDLENGTH is 4.

type=1,class=1,len=4\text{type}=1,\quad\text{class}=1,\quad\text{len}=4
A answerThe DNS answer record is decoded from exact fields.A answer80 bits / 10 bytes0x0001000100045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000001000101110110111000byte 8byte 91101100000100010type0x0001class0x0001rdlength4rdata93.184.216.34(cont.)

The address bytes

The RDATA bytes are 0x5db8d822, which decode to 93.184.216.34.

0x5db8d82293.184.216.340x5db8d822\leftrightarrow93.184.216.34
A answerThe DNS answer record is decoded from exact fields.A answer80 bits / 10 bytes0x0001000100045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000001000101110110111000byte 8byte 91101100000100010type0x0001class0x0001rdlength4rdata93.184.216.34(cont.)

Decode it again

The same answer shape can carry 8.8.8.8 with the same type, class, and data length.

0x080808088.8.8.80x08080808\leftrightarrow8.8.8.8
Second A answerThe DNS answer record is decoded from exact fields.Second A answer80 bits / 10 bytes0x00010001000408080808byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000001000000100000001000byte 8byte 90000100000001000type0x0001class0x0001rdlength4rdata8.8.8.8(cont.)

Summary

This is a single answer record, carrying one exact address value. Message structure and exact bytes only; resolution timing, caching, and UDP/TCP transport are not modeled here.

rdata93.184.216.34\text{rdata}\to93.184.216.34
A answerThe DNS answer record is decoded from exact fields.A answer80 bits / 10 bytes0x0001000100045db8d822byte 0byte 1byte 2byte 300000000000000010000000000000001byte 4byte 5byte 6byte 700000000000001000101110110111000byte 8byte 91101100000100010type0x0001class0x0001rdlength4rdata93.184.216.34(cont.)