Re: DNS response record format?
From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 07/16/04
- Next message: Peter Steele: "Re: How does RoundRobin flag work?"
- Previous message: Simon!: "Re: Unable to browse the Internet"
- In reply to: Peter Steele: "Re: DNS response record format?"
- Next in thread: Roger Abell [MVP]: "Re: DNS response record format?"
- Reply: Roger Abell [MVP]: "Re: DNS response record format?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Jul 2004 10:33:23 -0400
Just another idea. Instead of writing server code. You could also just
update the records on existing dns server. For example you can call nsupdate
in your program to update server RRs. Next query will then see the new
updates. In c# you could call nsupdate like you would call "dir" or other
dos program as a process. Perl also has a DNS module that has update
ability. Using either of these methods, you get as creative as you need as
to how update order is figured out (i.e. cpu %, hits, machine down, etc.)
Just remember that local client cache and intermediate dns server cache will
"wash" out most of your hard work unless you use a really low TTL - which
also has a price.
-- William Stacey, MVP "Peter Steele" <psteele@z-force.com> wrote in message news:uW4nf3zaEHA.1048@tk2msftngp13.phx.gbl... > 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: Peter Steele: "Re: How does RoundRobin flag work?"
- Previous message: Simon!: "Re: Unable to browse the Internet"
- In reply to: Peter Steele: "Re: DNS response record format?"
- Next in thread: Roger Abell [MVP]: "Re: DNS response record format?"
- Reply: Roger Abell [MVP]: "Re: DNS response record format?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|