apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bar...@veribox.net
Subject dns resolutions issues.
Date Tue, 14 Aug 2001 20:59:12 GMT
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.

barbee@myOtherGirlfriend> ./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

barbee@myOtherGirlfriend> ./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

barbee@myOtherGirlfriend> ./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.

Mime
View raw message