Skip Menu |
 

Subject: URI lookups don't work on Windows
Download (untitled) / with headers
text/plain 1.1KiB
The wshelper res_search() (invoked from dnsglue.c) calls
DnsQuery_A(). (The _A here refers to ANSI encoding, not DNS A
records). This Windows function helpfully parses the response packet
and yields a linked list of records, each decoded according to the
query type. wshelper undoes this work, reassembling a fake DNS
response packet from the query domain and resource records, so that
we can parse it again in dnsglue.c and dnssrv.c.

DnsQuery_A() has no support for URI records. Therefore,
res_quer.c:build_rr() has no code to piece together a URI record
encoding from a PDNS_RECORD. Although it is experimentally possible
to make a URI query and find the record encoding (un-decoded) in the
PDNS_RECORD function where the union rests, retrieving the record
this way seems unlikely to keep working if Windows ever implements
the URI type.

I am hoping to use the DNS_QUERY_RETURN_MESSAGE flag to get the
original DNS response packet so we don't have to reassemble it;
however, this flag is not documented well enough to use and I can
find no examples of code using it. I have asked Microsoft dochelp
for clarification and will report back with their answer.
DNS_QUERY_RETURN_MESSAGE does not seem to do anything (the docs say it
isn't supported in W2K, but they might actually mean it isn't supported
in W2K or later). After discussion with dochelp, it doesn't appear
that there's any future-proof way to use DnsQuery() with new record
types. So this bug seems unfixable for now, short of including or
depending on a complete DNS implementation.