Subject: Simple SRV lookup?

Simple SRV lookup?

From: Eric Nichols (DirWiz) <eric_at_dirwiz.com>
Date: Thu, 17 Dec 2009 10:56:50 -0500 (EST)

Hello, Just fell upon your library and am trying to run this on a mingw
system. The sample programs worked wonderfully however I think I'm missing
the basic steps to perform a simple SRV query. My sample code is below, I'm
thinking I'm missing some init settings but don't quite understand the sample
code.

It is currently returning:
ares_init: Misformatted domain name

I can't find any reference to this error message. Can anyone help? Ideally
I'm looking for a simple function to dump back a SRV record.

#include <stdio.h>
#include <ares.h>
#include <string.h>
#include <stdlib.h>

int main()
{
   int rc;
   ares_channel channel;

   rc=ares_library_init(ARES_LIB_INIT_ALL);

   if (rc != ARES_SUCCESS)
   {
      fprintf(stderr, "ares_library_init: %s\n", ares_strerror(rc));
      return 1;
   }

   rc=ares_init(&channel);
   if (rc != ARES_SUCCESS)
   {
      fprintf(stderr, "ares_init: %s\n", ares_strerror(rc));
      return 1;
   }

   printf("done!\n");
   return (EXIT_SUCCESS);
}

-- 
Thanks,
Eric
Received on 2009-12-17