Re: Query a DNS in C
phil-news-nospam_at_ipal.net
Date: 04/14/04
- Next message: phil-news-nospam_at_ipal.net: "Re: socket read,recv / signal handling"
- Previous message: Nick Landsberg: "Re: Help on OS assigment"
- In reply to: Jens.Toerring_at_physik.fu-berlin.de: "Re: Query a DNS in C"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: Query a DNS in C"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: Query a DNS in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Apr 2004 20:17:05 GMT
On 14 Apr 2004 16:22:53 GMT Jens.Toerring@physik.fu-berlin.de wrote:
| Christian <cgregoir99@yahoo.com> wrote:
|> I want to query a DNS within a C program to get the mail server associated
|> to a domain name, ie, the equivalent of the command 'host -t mx
|> <domain_name>'.
|
|> I've had a look at the bind-utils sources, and also run 'host' under gdb but
|> giving that it runs multiple threads, i'm lost.
|
|> Can anyone point any explicit doc (that is, not the RFC 1035), or the
|> specific source files inside the bind-utils tree that manage the
|> request-response stuff ?
|
| While I can send you some (not very well tested) source code that does
| that I guess it would be completely incomprehensible without understan-
| ding RFC 1035 (and possibly a few related RFC, like 974 and 1123). I
| would say that the RFCs are the _most_ explicit documentation you can
| find. What else are you looking for exactly?
I think what the OP is really wanting is a simple set of tools (e.g. that
do this function and not much else) that encapsulates the details (what is
in RFC 1035) and lets the caller use a simple API to send queries and read
the results. Whether that API would simply be a "build and breakdown" API
for DNS datagrams, or a more sophisticated system that waits for multiple
events and does timesout, would be a design decision.
I have been thinking of writing just such a set of functions myself, but it
is still in the "surveying what others might need" phase for now (which this
thread might well contribute to).
I think BIND's tools are overkill for what the OP wants.
-- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ | | (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ | -----------------------------------------------------------------------------
- Next message: phil-news-nospam_at_ipal.net: "Re: socket read,recv / signal handling"
- Previous message: Nick Landsberg: "Re: Help on OS assigment"
- In reply to: Jens.Toerring_at_physik.fu-berlin.de: "Re: Query a DNS in C"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: Query a DNS in C"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: Query a DNS in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|