tags:

views:

68

answers:

1

I have a windows C++ application (mingw, but I guess it doesn't matter). I need to do very occasional obscure types of DNS lookups, such as TXT and AXFR.

The best I can do at the moment is using gethostbyname in winsock, but that doesn't support the above types :(. Does anyone know of a nice library that runs on win32 for DNS lookups?

thanks

thn

+1  A: 

I recommend using libunbound which is included in the source distribution of the Unbound recursive DNS server.

It's a full-feature recursive resolver bundled in a library. Alternatively the same group has a generic DNS library with a stub resolver called ldns.

p.s. are you sure mingw doesn't support the UNIX standard libresolv? Check for a function called res_query.

Alnitak
I've been reading the ldns source today, which led me to conclude that unbound is a much better suggestion, so I decided to remove my answer. +1 from me ;-)
jweyrich