Change in res_nsearch behaviour?

G Muthukumar muthu at
Tue Jan 25 13:46:00 UTC 2000


	Is there any reason behind the changed behaviour of res_nsearch?
In BIND 8.2.x (including 8.2.2-P5), the function res_nsearch does not do 
any searching if there is a dot in the name. It tries the name 'as is' and
returns. It does not seem to be doing the search in the current/parent 
domains if the 'as is' query failed. But according to the man page (ndots 
option), the 'search list' elements will be appended.

Here is the code from BIND 8.2.2-P5 res_nsearch() (line no. 210 of 

         * If there are enough dots in the name, do no searching.
         * (The threshold can be set with the "ndots" option.)
        if (dots >= statp->ndots || trailing_dot)
                return (res_nquerydomain(statp, name, NULL, class, type,
                                         answer, anslen));

whereas the code from BIND 4.9.7 res_search():

        saved_herrno = -1;
        if (dots >= _res.ndots) {
                ret = res_querydomain(name, NULL, class, type, answer,
                if (ret > 0)
                        return (ret);
                saved_herrno = h_errno;

	(I found this to be a useful feature when one has multiple
subdomains to resolve hostnames of other subdomains).

	Is this an expected behaviour or a bug? Or Did I misunderstand

	If this was discussed already, my apologies to the list.


More information about the bind-workers mailing list