Re: DNS response record format?
From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 07/16/04
- Next message: William Stacey [MVP]: "Re: How does RoundRobin flag work?"
- Previous message: James Carter [MVP]: "Re: change secondary zone to AD integrated"
- In reply to: Peter Steele: "DNS response record format?"
- Next in thread: Peter Steele: "Re: DNS response record format?"
- Reply: Peter Steele: "Re: DNS response record format?"
- Messages sorted by: [ date ] [ thread ]
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. > >
- Next message: William Stacey [MVP]: "Re: How does RoundRobin flag work?"
- Previous message: James Carter [MVP]: "Re: change secondary zone to AD integrated"
- In reply to: Peter Steele: "DNS response record format?"
- Next in thread: Peter Steele: "Re: DNS response record format?"
- Reply: Peter Steele: "Re: DNS response record format?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|