In article <36698c44.926736@news.flash.net>,
nospam@rocketmail.com (tim ishi) writes:
>Hi, I recently wrote a program that uses res_search() from the
><resolv.h> library to lookup the MX records for various domains. The
>only documentation I could find for these <resolv.h> functions (man
>pages) neglect to explain how to interpret the results. I wrote my
>own function that parses the buffer and extracts what I need, but it
>only works about 85% of the time because the assumptions I made about
>the return buffer, do not always hold true. If anyone has used these
><resolv.h> functions before or knows about some resources that explain
>how to interpret the return buffer, that'd really help me out.
I vaguely recall them described in a book, I think
probably O'Reiley's DNS and BIND, but of course I
can't find my copy just now to check!
Also, check out the source of sendmail, which
regardless of any documentation, is pretty much
the definative user of res_search() for MX
lookups.
--
Andrew Gabriel
Consultant Software Engineer
|