Reading NAPTR records - how?

  • Thread starter Thread starter Paul D.Smith
  • Start date Start date
P

Paul D.Smith

Anyone know how I can read a NAPTR record? I've tried using DnsQuery() but
can't figure out how to get to the response. There is no NAPTR specific
structure and I don't seem to be able to get to the raw DNS response.

Thanks for any help you can offer,
Paul DS.
 
OK, after much trial and error, I have discovered the following.

If the record is of a "Windows knows" type (e.g. SRV or A record), then
Windows "helpfully" converts the response into the appropriate data
structure, e.g. DNS_SRV_DATA, which is in the Data field of each record
returned by DnsQuery().

If the record is _NOT_ of a known type (and NAPTR is _not_ a type that
Windows understands, despite having a #define for the record type), then the
response is presented, untouched, in the Data field and the wDataLength
field indicates how many bytes are present.

Note that multplie NAPTR records are still presented as a chain of multiple
DNS_RECORD structure and the pNext field is still used to traverse the list.
Also, the Dns free functions should still be used to free the data.

Is this inconsistent and a recipe for future problems? Yes or course it is
but then what did you expect :-).

Paul DS.
 
Back
Top