RES_TIMEOUT and RES_RETRY for ping and nslookup - differences - Aix

This is a discussion on RES_TIMEOUT and RES_RETRY for ping and nslookup - differences - Aix ; Hi, We recently had a DNS server failure and due to us using default values for RES_TIMEOUT and RES_RETRY meant AIX was taking a long time to move from the first server in resolv.conf to the second server (it was ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: RES_TIMEOUT and RES_RETRY for ping and nslookup - differences

  1. RES_TIMEOUT and RES_RETRY for ping and nslookup - differences

    Hi,

    We recently had a DNS server failure and due to us using default
    values for RES_TIMEOUT and RES_RETRY meant AIX was taking a long time
    to move from the first server in resolv.conf to the second server (it
    was the first server that had failed).

    I am looking at decreasing the paramter values and have found that I
    get different delays depending on if I do an nslookup or ping. Note
    the time is not totally accurate - just taken from me looing at my
    watch but it gives a good idea. Also I have just two DNS servers,
    first in list is down and second is up. The time is how long it takes
    to get a response back at the command line.

    RES_TIMEOUT=1
    RES_RETRY=2

    ping takes 1 sec
    nslookup takes 3 secs

    RES_TIMEOUT=1
    RES_RETRY=3

    ping takes 1 secs
    nslookup takes 8 secs

    RES_TIMEOUT=1
    RES_RETRY=4

    ping takes 1 sec
    nslookup takes 16 secs

    I would have thought they would have been the same (I was using the
    same server to ping and nslookup on and also tried various servers as
    well so there shouldnt have been anything cached anywhere).

    >From other tests (ie altering RES_TIMEOUT) it seems ping just relies

    on the RES_TIMEOUT before it moves down the list of DNS servers but
    for nslookup it seems the RES_RETRY comes into play and it tries each
    DNS server for the number of times set by RES_RETRY before moving onto
    the next DNS server.

    I dont think its a big worry as I am just going to make RES_TIMEOUT=2
    and RES_RETRY=1 anyway, but I was just curious as to why it behaved
    differently.

    If I just have the dodgy DNS server in resolv.conf and remove the good
    server then the results sort of reverse, ie the ping takes longer to
    timeout than the nslookup.

    Regards,
    Scott


  2. Re: RES_TIMEOUT and RES_RETRY for ping and nslookup - differences

    Hi,

    IMHO it works like this or quite similar.

    total_timeout=0;
    timeout=RES_TIMEOUT;
    for(int i=1; i<=RES_RETRY; i++) {
    total_timeout=total_timeout+timeout;
    timeout=timeout*2
    }
    So total_timeout is a time spent to resolve name using every server in
    resolv.conf
    If first fails after all attempts it tries next one in the list.

    ping and nslookup have nothing common as they use different protocols
    and timouts, therefore results are different.



+ Reply to Thread