[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

resolver newbie



Hi people.

Whats wrong with this picture ?

<sarre_(_at_)_lyx101>$ cat testResolv.c
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>

int main()
{
        int result;
        char domain[] = "openbsd.org";
        unsigned char answer[8192];

        res_init();
        _res.options |= RES_DEBUG;
        _res.retry = 2;

        result = res_query(domain, C_IN, T_MX, answer, sizeof(answer));
        printf("res_query returned %d\n");

        exit(0);
}


<sarre_(_at_)_lyx101>$ gcc testResolv.c
<sarre_(_at_)_lyx101>$ ./a.out
res_query returned -541075308

meanwhile:
<root_(_at_)_lyx101># tcpdump -n -p port 53
19:34:55.502322 x.x.x.x.38347 > y.y.y.y.53:  46132+ MX? openbsd.org. (29)
19:34:55.503169 y.y.y.y.53 > x.x.x.x.38347:  46132 2/5/6 MX cvs.openbsd.org. 10, (292)
<root_(_at_)_lyx101># uname -a
OpenBSD lyx101 2.8 GENERIC#399 i386

What am I missing here ?

BTW, whoever implemented the login.conf stuff in 2.8, thanks a lot.

Tony S
	Confused and tired network janitor





Visit your host, monkey.org