Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 455492 - with gentoo's glibc option attempts from /etc/resolv.conf does not work
Summary: with gentoo's glibc option attempts from /etc/resolv.conf does not work
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-04 20:23 UTC by Dmitry
Modified: 2013-02-04 22:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry 2013-02-04 20:23:28 UTC
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
Comment 1 Mike Gilbert gentoo-dev 2013-02-04 20:32:18 UTC
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?
Comment 2 Dmitry 2013-02-04 20:51:33 UTC
with nslookup from bind-tools
Comment 3 Dmitry 2013-02-04 20:54:16 UTC
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
Comment 4 Mike Gilbert gentoo-dev 2013-02-04 20:57:02 UTC
Ok, how are you testing the system resolver?
Comment 5 Mike Gilbert gentoo-dev 2013-02-04 20:58:58 UTC
(as far as I know, nslookup bypasses the system resolver entirely and performs direct lookups itself)
Comment 6 Dmitry 2013-02-04 21:16:34 UTC
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.
Comment 7 Dmitry 2013-02-04 21:28:40 UTC
> 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.
Comment 8 Mike Gilbert gentoo-dev 2013-02-04 21:43:00 UTC
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
Comment 9 Dmitry 2013-02-04 22:01:25 UTC
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.
Comment 10 Mike Gilbert gentoo-dev 2013-02-04 22:27:24 UTC
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.