[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#343140: libc6: resolver always checks search list in /etc/resolv.conf



Stephen Gran wrote:
This one time, at band camp, Edward Buck said:

If you read further down the man page:

"ndots:n sets a threshold for the number of dots which must appear in a
name given to res_query() (see resolver(3)) before an initial absolute
query will be made."

There's no ambiguity in the term 'absolute query'.  A lookup for the
IPv6 address example.com.domain.in.search.path is NOT an initial
absolute query no matter how you look at it.

Unless of course you missed the part of the report where the query under
discussion has greater than ndots in it.  The original query under
discussion was mx1.hotmail.com, and ndots was unset, so defaulted to 1.
There are 2 dots in mx1.hotmail.com, so the search order was correctly
used.  That it defaulted to ipv6 first is the only thing really left for
discussion, it seems to me.

The issue is that it defaulted to the IPv6 _family_ first. It's not a bug that IPv6 is tried first since RFC's recommend that. And even with the original query of mx1.hotmail.com, I'm saying that the search order is _not_ correct. Let's say the search line has:

search domain1.com domain2.com

The correct query order for mx1.hotmail.com (containing 2 dots) should be:

1. mx1.hotmail.com. - AAAA
2. mx1.hotmail.com. - A
3. mx1.hotmail.com.domain1.com. - AAAA
4. mx1.hotmail.com.domain1.com. - A
5. mx1.hotmail.com.domain2.com. - AAAA
6. mx1.hotmail.com.domain2.com. - A

If step 1 or 2 returns a host address, step 3 and later are skipped.

The Debian (or glibc) query order is:

1. mx1.hotmail.com. - AAAA
2. mx1.hotmail.com.domain1.com. - AAAA
3. mx1.hotmail.com.domain2.com. - AAAA
4. mx1.hotmail.com. - A
5. mx1.hotmail.com.domain1.com. - A
6. mx1.hotmail.com.domain2.com. - A

With Debian's query order, mx1.hotmail.com exists as an A record yet the system doesn't check until it has already done 3 queries, 2 of which do not qualify as an 'initial absolute query'.

The bug is not just limited to those who use the search line. If your resolv.conf contains 'domain ...', e.g.

domain example.com
nameserver x.x.x.x
nameserver y.y.y.y

Then a query of mx1.hotmail.com will ALWAYS yield:

1. mx1.hotmail.com. - AAAA
2. mx1.hotmail.com.example.com. - AAAA (extraneous)
3. mx1.hotmail.com. - A

In other words, Debian's networking already starts at a disadvantage (doing extra queries) as long as you use _either_ 'search' or 'domain' in /etc/resolv.conf.

Regards,
Ed



Reply to: