hi,
i've been two different dns problems recently on freebsd and linux.
one, example is doubleclick, resolution takes a long time. using
nslookup returns immediately.
two, example is www.cpan.org, resolution sometimes works and sometimes
doesn't work. using nslookup works.
[EMAIL PROTECTED]> ./a.out
hola mundo!
status for ad.doubleclick.net is 0
status for www.cpan.org is 22007
status for www.apache.org is 0
[EMAIL PROTECTED]> ./a.out
hola mundo!
status for ad.doubleclick.net is 0
status for www.cpan.org is 0
status for www.apache.org is 0
[EMAIL PROTECTED]> ./a.out
hola mundo!
status for ad.doubleclick.net is 0
status for www.cpan.org is 22007
status for www.apache.org is 0
with doubleclick, we're sitting in multiple getaddrinfo() calls,
called by apr_sockaddr_info_get.
when cpan fails on freebsd, the operating system is returning
EAI_NODATA. linux also returns some error code that apr interprets
as
Unknown resolver error.
is anybody else seeing this?
below is my test program.
#include "apr.h"
#include "apr_general.h"
#include "apr_strings.h"
#include "apr_pools.h"
#include "apr_network_io.h"
int main(int argc, const char * const argv[]) {
apr_pool_t *pglobal;
apr_status_t status;
apr_sockaddr_t *uri_addr;
apr_initialize();
status = apr_pool_create(&pglobal, NULL);
if ( status != APR_SUCCESS ) {
printf("unable to allocate memory pool.\n");
}
printf("%s", apr_psprintf(pglobal, "hola mundo!\n"));
status = apr_sockaddr_info_get(&uri_addr, "ad.doubleclick.net",
APR_UNSPEC,
80, 0, pglobal);
printf("status for ad.doubleclick.net is %d\n", status);
status = apr_sockaddr_info_get(&uri_addr, "www.cpan.org", APR_UNSPEC,
80, 0,
pglobal);
printf("status for www.cpan.org is %d\n", status);
status = apr_sockaddr_info_get(&uri_addr, "www.apache.org", APR_UNSPEC,
80,
0, pglobal);
printf("status for www.apache.org is %d\n", status);
return 1;
}
barbee.