DNSQuery with no recursion

  • Thread starter Thread starter James Brunner
  • Start date Start date
J

James Brunner

Hi,

Hope someone can help.

I am running a DNS_TYPE_A query for a domain name against the all the
root-servers with the DNS_QUERY_NO_RECURSION option (and the
DNS_QUERY_RETURN_MESSAGE etc..) and expected to get back a packet with
the "authoratative" and "additional" fields populated - I used
SnifferPro and the raw DNS packet does come back to the PC with all
the expected structure - so at least my request goes out and comes
back correctly....

However, the DNS_QUERY() call returns with a 9002 error
(DNS_ERROR_RCODE_SERVER_FAILURE) and the DNS_RECORD structure remains
empty.

If I allow the call to return the raw data (use the *pReserved
variable) the DNS header structure (DNS_HEADER in windns.h) is offset
from the *pReserved pointer by 104 bytes.

Is there an easier way to get this data out of the call?

Thanks in advance.

JB.
 
Use a tool like netdig (www.mvptools.com) or dig at www.isc.org in the bind
build for NT and use -trace option to send RD=false query to each NS and
iterate down.

C:\Temp>netdig @a.root-servers.net yahoo.com a -trace

NetDig 2.0rc4 >> yahoo.com. a /trace

Query DNS Server Server Reply
----------------------------------- -----------------------------------
.. -> L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. -> A.GTLD-SERVERS.NET.
A.GTLD-SERVERS.NET. -> ns1.yahoo.com.
ns1.yahoo.com. yahoo.com.

ns1.yahoo.com. Reply:
---------------------
yahoo.com. 300 IN A 66.218.71.112
yahoo.com. 300 IN A 66.218.71.113
yahoo.com. 300 IN A 66.218.71.114
yahoo.com. 300 IN A 216.109.127.28
yahoo.com. 300 IN A 216.109.127.29
yahoo.com. 300 IN A 216.109.127.30

Dig Example
======================
C:\>dig @j.root-servers.net yahoo.com a +trace

; <<>> DiG 9.2.3rc4 <<>> @j.root-servers.net yahoo.com a +trace
;; global options: printcmd
.. 518400 IN NS M.ROOT-SERVERS.NET.
.. 518400 IN NS I.ROOT-SERVERS.NET.
.. 518400 IN NS E.ROOT-SERVERS.NET.
.. 518400 IN NS D.ROOT-SERVERS.NET.
.. 518400 IN NS A.ROOT-SERVERS.NET.
.. 518400 IN NS H.ROOT-SERVERS.NET.
.. 518400 IN NS C.ROOT-SERVERS.NET.
.. 518400 IN NS G.ROOT-SERVERS.NET.
.. 518400 IN NS F.ROOT-SERVERS.NET.
.. 518400 IN NS B.ROOT-SERVERS.NET.
.. 518400 IN NS J.ROOT-SERVERS.NET.
.. 518400 IN NS K.ROOT-SERVERS.NET.
.. 518400 IN NS L.ROOT-SERVERS.NET.
;; Received 436 bytes from 192.58.128.30#53(j.root-servers.net) in 46 ms

com. 172800 IN NS A.GTLD-SERVERS.NET.
com. 172800 IN NS G.GTLD-SERVERS.NET.
com. 172800 IN NS H.GTLD-SERVERS.NET.
com. 172800 IN NS C.GTLD-SERVERS.NET.
com. 172800 IN NS I.GTLD-SERVERS.NET.
com. 172800 IN NS B.GTLD-SERVERS.NET.
com. 172800 IN NS D.GTLD-SERVERS.NET.
com. 172800 IN NS L.GTLD-SERVERS.NET.
com. 172800 IN NS F.GTLD-SERVERS.NET.
com. 172800 IN NS J.GTLD-SERVERS.NET.
com. 172800 IN NS K.GTLD-SERVERS.NET.
com. 172800 IN NS E.GTLD-SERVERS.NET.
com. 172800 IN NS M.GTLD-SERVERS.NET.
;; Received 459 bytes from 202.12.27.33#53(M.ROOT-SERVERS.NET) in 187 ms

yahoo.com. 172800 IN NS ns1.yahoo.com.
yahoo.com. 172800 IN NS ns2.yahoo.com.
yahoo.com. 172800 IN NS ns3.yahoo.com.
yahoo.com. 172800 IN NS ns4.yahoo.com.
yahoo.com. 172800 IN NS ns5.yahoo.com.
;; Received 197 bytes from 192.5.6.30#53(A.GTLD-SERVERS.NET) in 46 ms

yahoo.com. 300 IN A 66.218.71.112
yahoo.com. 300 IN A 66.218.71.113
yahoo.com. 300 IN A 66.218.71.114
yahoo.com. 300 IN A 216.109.127.28
yahoo.com. 300 IN A 216.109.127.29
yahoo.com. 300 IN A 216.109.127.30
yahoo.com. 172800 IN NS ns1.yahoo.com.
yahoo.com. 172800 IN NS ns2.yahoo.com.
yahoo.com. 172800 IN NS ns3.yahoo.com.
yahoo.com. 172800 IN NS ns4.yahoo.com.
yahoo.com. 172800 IN NS ns5.yahoo.com.
;; Received 293 bytes from 66.218.71.63#53(ns1.yahoo.com) in 78 ms
 
Back
Top