Question : Where is the offset in the DNS compression measured from?

I'm writing a DNS parser as an exercise to teach myself a bit more about DNS.
I'm stuck on one thing right now, which is, where is the DNS compression offset marker measured from?
The start of the packet?
The byte after the end of the headers?
A per query/answer basis?
I know how to mask it and get the offset, I only need to know where it's being measured from.

Answer : Where is the offset in the DNS compression measured from?


> I know how to mask it and get the offset, I only need to know where it's being measured from.

Missed this bit which might render the above moot. From the beginning of the DNS packet. The 12 used in the example above would be immediately after the end of the header (the header, as I'm sure you know is 12 bytes long), so it's a pointer to the name value in the question.

Chris
Random Solutions  
 
programming4us programming4us