|
-
Sep 16th, 2009, 06:59 PM
#1
-
Sep 16th, 2009, 09:01 PM
#2
Re: How to perform a DNS query
Here is a good article that gives you all of the bytes you need to send. The article is for C# code, but they explain the concepts well enough that you should be able to run with it:
http://www.codeproject.com/KB/IP/dnslookupdotnet.aspx
-
Sep 17th, 2009, 03:46 AM
#3
Re: How to perform a DNS query
Thanks, I looked at that article before but somehow completely missed this paragraph:
Both request and response share the same format, which starts with a 12 byte header block. This starts with a two byte message identifier. This can be any 16 bit value and is echoed in the first two bytes of the response, and is useful as it allows us to match up requests and responses as UDP makes no guarantees about the order in which things arrive. After that follows a two byte status field which in our request has just one single bit set, the recursion desired bit. Next comes a two byte value denoting how many questions there are in the request, in this case just 1. There then follows three more two byte values denoting the number of answers, name server records and additional records. As this is a request, all these are zero.
Which seems to explain exactly what I wanted to know I'll have a play around and see if I can get it working, cheers
-
Sep 17th, 2009, 06:06 AM
#4
Member
Re: How to perform a DNS query
-
Sep 17th, 2009, 06:42 AM
#5
Re: How to perform a DNS query
 Originally Posted by InertiaM
Thanks for the suggestion but that uses the built in NSLOOKUP program that comes with Windows - Whilst i could call that and parse the output I would much rather try and do this all in my own code instead of relying on an external program
-
Sep 23rd, 2009, 06:33 AM
#6
Re: How to perform a DNS query
Marking this as resolved as the discussion has kind of moved to this thread now: http://www.vbforums.com/showthread.php?p=3614041
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|