subj. with gentoo's glibc option attempts from /etc/resolv.conf does not work I see the same behaviour in Ubuntu 10.04.4 LTS. Same in SystemRescueCD, based on gentoo, with glibc 2.15-r3 Reproducible: Always Steps to Reproduce: just 1 - try to use the following resolv.conf # testing new configuration search ru domain ru nameserver 172.16.1.1 nameserver 172.16.2.1 nameserver 8.8.8.8 nameserver 8.8.4.4 options debug timeout:1 attempts:2 2 - use # tcpdump -ni $interface_name port 53 to see, that option attempts just does not work Resolver process makes only one attempt, than switches to the next DNS-server Actual Results: Resolver process makes only one attempt, than switches to the next DNS-server Expected Results: Resolver process should make two attempts before switching to the next DNS-server. There is a confirmed and already fixed bug in RedHat's bugzilla. And a patch. Look here, please: https://bugzilla.redhat.com/show_bug.cgi?id=570851 https://bugzilla.redhat.com/attachment.cgi?id=398077&action=diff
The Redhat bug report doesn't seem to be about glibc specifically. Are you testing this with the "host" command from net-dns/bind-tools?
with nslookup from bind-tools
when you use tcpdump in one terminal and nslookup in another you see all pauses and all queries very well. system resolver makes only one attempt, than switches to thee next server
Ok, how are you testing the system resolver?
(as far as I know, nslookup bypasses the system resolver entirely and performs direct lookups itself)
you can also use commands like $ host www.ru or $ telnet www.ru 22 instead of nslookup, if you do not trust nslookup. The behaviour still stays the same: first query (A) goes to the first specified DNS-server, second query (A) goes to the second DNS-server already. If you use telnet and if you use IPv6 on your machine, then you will also see AAAA queries, but they do not matter in this case, the behaviour for IPv6 is the same.
> The Redhat bug report doesn't seem > to be about glibc specifically. > OK, may be I am wrong in specifying exact package. But files /usr/include/resolv.h and especially /usr/include/netdb.h which are mentioned in the man pages of gethostbyaddr and resolv.conf, both of them belong to glibc package.
It seems to be working in some fashion here; setting attempts:4 causes many more queries to appear than attempts:1. It seems to cycle through each server and then tries again. I'm using "getent hosts" and ping to test; I am certain both use the C library for name resolution. Here's my resolv.conf: nameserver 1.2.3.4 nameserver 1.2.3.5 #nameserver 127.0.0.1 options attempts:1
Sorry, you are definitely right. This is not a bug, this is my misunderstanding of the man page.. After that I went straight to google, found similar bug in redhat's bugzilla, and came here.. Sorry. But is there any possibility to set up resolv.conf the way I want? Two attempts to reach the first DNS-server, then two attempts to reach the second, then two attempts to reach the third? My problem is that my third DNS-server has some differences in configuration with the first two, my third DNS-server does not know about several internal zones.. so I want to use it only if there is no other way.
I don't know the answer to that one. You might try asking in the forums, on the gentoo-user list, or in #gentoo on Freenode.