Format of Resource Record in DNS

dns

There is RDATA fiels in answer section of DNS message (as in section 4.1.3 of rfc 1035. Please explain how to retrieve IP address from this RDATA field means how this field is split
up?

Best Answer

The IP address in an A record is just stored as a 32-bit integer. To decode it into the standard dotted form, you simply split the 32-bit integer into 4 8-bit integers, and those become the four numbers in the standard dotted form.

Section 2.3.2 talks about the order the bits are in. Basically, it's big endian, with octets in order.

Related Topic