Bug#839697: libc6: libresolv cannot resolve hosts with malformed "attempts"
Package: libc6
Version: 2.24-3
Severity: normal
Tags: upstream
While reconfiguring the /etc/resolv.conf, the integer parameter for "attempts" was
removed. I'm not sure if I'd call this a bug in the documentation or in the library
itself. It seems that what happens is that when the file contains something
like "attmepts:" (note the missing parameter), the libresolv returns after zero
attempts.
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.200.1
nameserver fe80::a263:91ff:fe71:e007%wlp3s0
$ dig +short -t A www.yahoo.com
fd-fp3.wg1.b.yahoo.com.
98.139.180.149
98.139.183.24
$ telnet -4 www.yahoo.com 80
Trying 98.139.180.149...
Connected to fd-fp3.wg1.b.yahoo.com.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
$ echo "options attempts:" >> /etc/resolv.conf
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.200.1
nameserver fe80::a263:91ff:fe71:e007%wlp3s0
options attempts:
$ dig +short -t A www.yahoo.com
fd-fp3.wg1.b.yahoo.com.
98.139.183.24
98.139.180.149
$ telnet -4 www.yahoo.com 80
telnet: could not resolve www.yahoo.com/80: Name or service not known
$
I marked this as upstream as I also tested this in CentOS, and the same issue
exists there. Based on the documentation from "man 5 resolv.conf", this is unexpected
behavior. The documentation states that the default is 2, while it is silently
capped at 5. It makes no mention about what the absence of a parameter might do.
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages libc6 depends on:
ii libgcc1 1:6.1.1-11
libc6 recommends no packages.
Versions of packages libc6 suggests:
ii debconf [debconf-2.0] 1.5.59
pn glibc-doc <none>
ii libc-l10n 2.24-3
ii locales 2.24-3
-- debconf information:
glibc/kernel-not-supported:
glibc/disable-screensaver:
* libraries/restart-without-asking: false
glibc/restart-failed:
glibc/kernel-too-old:
* glibc/restart-services: exim4 cron atd
glibc/upgrade: true
Reply to: