Re: DNS response record format?

From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 07/16/04


Date: Fri, 16 Jul 2004 00:51:24 -0400

As Roger said, 1034 and 1035 are the best recourses to get started. Like
most things, putting together a simple request/reply is pretty straight
forward, however things get really complicated quick if supporting multiple
RR types. Then add resolver logic, local lookup logic, cache logic, update
logic, zones, nodes, rrsets, rr's, dnssec, etc, etc. That said, doing reply
for one or two records without any recursive logic is pretty easy. I would
start with RRs.

I created an abstract RR class and derived all other RRs from it. The base
class has ownerName, TTL, Type, Class, and RData string. This is common
across all RRs. Your derived classes will be specific to its type. So an A
record will have a constructor that also takes an IPAddress, an NS record
will have DName string, an SOA record will have many args, etc. The first
challenge you run into is parsing. You need to parse the byte[] request
into sections and parse the request out of it. That is ok. You then need
to see what record type is requested and parse the rdata bytes correctly for
the type. You also need to figure out name compression logic which is a bit
tricky. Domain names and domain labels can be scattered around the request
and the reply ( if your also doing a client resolver.) Servers are expected
to do name compression for replies also. Your server also needs to parse
text records to build the internal Zone/RR memory structure. Your RR
classes also need to be able to parse their data types back into a byte[] to
build the reply. This is all pretty easy to hard code for very simple need,
but to make it general and real-world requires a lot of work. All this only
scratches the surface of what you will need to do if you take the blue pill
(or is that the red one?). Good luck with your project. hth. BTW, what
language will you be using? Cheers.

-- 
William Stacey, MVP
"Peter Steele" <psteele@z-force.com> wrote in message
news:eYiq7vraEHA.1656@TK2MSFTNGP09.phx.gbl...
> Can anyone point me to a good source, preferably with programming
examples,
> describing the format of a DNS response record. I need to write a simple
DNS
> server that is used to resolve just a few special names in our domain.
I've
> got the basic code infrastructure designed but what I'm having problem
with
> is how to create the response record. Any pointers would be appreciated.
>
>


Relevant Pages

  • Re: DNS response record format?
    ... Microsoft MVP (Windows Server System: ... > update the records on existing dns server. ... >>> into sections and parse the request out of it. ...
    (microsoft.public.windows.server.dns)
  • Re: DNS response record format?
    ... Instead of writing server code. ... update the records on existing dns server. ... >> into sections and parse the request out of it. ...
    (microsoft.public.windows.server.dns)
  • Re: help, i am in panic.....7 days of tutorials and experiments...
    ... Then why not suggest a way to parse a name field as requested, ... it is from a website info request form with fields that are ... and track responses and automatically email the response after ... but the data base dose not load my 6 entries. ...
    (microsoft.public.access.gettingstarted)
  • History Replacement And New Location Combined
    ... Since each page would run restorePage() function on the ... // Parse the form and add parameters to the current location.search ... As could be seen from the code above, I synchronize replace and load ... requests, giving the replace request a full second to execute. ...
    (comp.lang.javascript)
  • Parsing XML data as it arrives from LWP call
    ... I am trying to improve the performance of a Perl application that uses LWP ... I would like to parse the resulting XML data as it's being returned as ... Build request XML input parms ...
    (comp.lang.perl.modules)

Loading