On Fri, Sep 13, 2013 at 03:01:45PM +0300, Kapetanakis Giannis wrote:

> Hi,
> 
> Could someone help me debug this following program on OBSD?
> 
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <arpa/inet.h>
> #include <arpa/nameser.h>
> #include <resolv.h>
> 
> main() {
>       int i;
>       res_init();
>       printf("Number of NS in resolv.conf is %d\n", _res.nscount);
> 
>       for (i=0; i< _res.nscount; i++) {
>               printf("NS %d is %s\n", i, 
> inet_ntoa(_res.nsaddr_list[i].sin_addr));
>       }
> }
> 
> on linux I get the NS addresses correct
> on OBSD I get 0.0.0.0 for all name servers defined in /etc/resolv.conf
> 
> is there something I'm missing?
> 
> Thanx
> 
> G
> ps. This is for debugging an old program that fails to resolv on
> OBSD while it does on linux.

Groping into _res is not a wise thing. The OpenBSD async resolver only
has minimal support for that. 

ASR_DEBUG=1 ./a.out

Will probably get you the debug info you want.

        -Otto

Reply via email to