Re: DNS response record format?
From: Peter Steele (psteele_at_z-force.com)
Date: 07/16/04
- Next message: Simon!: "Re: Unable to browse the Internet"
- Previous message: Kevin D. Goodknecht Sr. [MVP]: "Re: Unable to browse the Internet"
- In reply to: William Stacey [MVP]: "Re: DNS response record format?"
- Next in thread: William Stacey [MVP]: "Re: DNS response record format?"
- Reply: William Stacey [MVP]: "Re: DNS response record format?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Jul 2004 07:05:30 -0700
What language am I using? I'd *like* to use C# and a nice .NET class that
abstracts the whole thing, but it appears there is no such class.
Fortunately, I've dug up some existing C/C++ code that looks like it will do
the trick. It seems the DNS structure isn't exactly "user friendly." The
main reason I'm writing this is to implement a primitive load distribution
system. In my research I discovered the DNS RobinRobin flag that I made
another post about. It may very well be that we can use that, but I'll have
to see it in action to make sure it does what we want.
Peter
"William Stacey [MVP]" <staceywREMOVE@mvps.org> wrote in message
news:uToXfEvaEHA.1840@TK2MSFTNGP11.phx.gbl...
> 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: Simon!: "Re: Unable to browse the Internet"
- Previous message: Kevin D. Goodknecht Sr. [MVP]: "Re: Unable to browse the Internet"
- In reply to: William Stacey [MVP]: "Re: DNS response record format?"
- Next in thread: William Stacey [MVP]: "Re: DNS response record format?"
- Reply: William Stacey [MVP]: "Re: DNS response record format?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|