DNS programming

Michael Sedlak sedlak at nortelnetworks.com
Tue Aug 31 22:22:25 UTC 1999


Hi all!

I am working on a program that sends queries to a DNS and gets back its
replies. So far, I studied the "DNS and BIND"-book published by
O'reilly. 

What I could not find in this book is an explicit description how a
query is built. As far as I know, all the parameters of the header and
question are put into a character string that is sent to the DNS query.
The same happens when the answer is received as a character string.

I want to know in which format all parameters are put into this
character string. (I am programming in C/C++)
For example: qr is a boolean value, true or false. Is it written as one
character like "0"/"1" or "t"/"f" or together with other parameters into
one character to save space? How is a 16bit-integer written into the
query message? Are all of the 16 bits written separately (e.g.
0000111010100011) or as a two-character-value?

I would appreciate it very much if anybody could answer my questions.
When you know any web-address where I can find source code dealing with
this, please tell me so.

Thanks,
Michael


More information about the bind-users mailing list