finding authoritative nameservers

Ronald F. Guilmette rfg at tristatelogic.com
Tue May 20 04:06:17 UTC 2008


In message <200805200321.m4K3LZFS030543 at drugs.dv.isc.org>, 
Mark Andrews <Mark_Andrews at isc.org> wrote:

>I wrote:
>> OK.  How?  I really do not know how.  Please enlighten me.
>
>#include <sys/types.h>
>#include <netinet/in.h>
>#include <arpa/nameser.h>
>#include <resolv.h>
>
>main(int argc, char **argv) {
>        char zonename[MAXDNAME];
>        unsigned char buf[0xffff];
>        int n;
>
>
>        if (!argv[1])
>                exit (0);
>        n = res_init();
>        if (n > 0)
>                n = res_findzonecut(&_res, argv[1], C_IN, 0,
>                                    zonename, sizeof(zonename), NULL, 0);
>        if (n > 0)
>                n = res_query(zonename, C_IN, T_NS, buf, sizeof(buf));
                                               ^^^^

OK.  I think I got it now.  It was just that T_NS part that I wasn't too
sure about.  But now it all makes sense.  Thank you.  Really.



More information about the bind-users mailing list