Bug 703239 - Space after nameserver entry in /etc/resolv.conf causes failed DNS lookups with ping6
Summary: Space after nameserver entry in /etc/resolv.conf causes failed DNS lookups wi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc
Version: 5.4
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Jeff Law
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 789189
TreeView+ depends on / blocked
 
Reported: 2011-05-09 17:20 UTC by Jonathan Barber
Modified: 2016-11-24 15:50 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Same as RHEL 6.3 BZ 789189
Clone Of:
: 789189 (view as bug list)
Environment:
Last Closed: 2013-01-08 03:45:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0022 0 normal SHIPPED_LIVE glibc bug fix and enhancement update 2013-01-08 08:38:20 UTC

Description Jonathan Barber 2011-05-09 17:20:51 UTC
Description of problem:

If /etc/resolv.conf contains an IPv6 nameserver entry with a space after the IP address, then clients only try to resolve the entry via the localhost, which fails because I don't have a nameserver locally:
# cat -e /etc/resolv.conf
nameserver 2001:470:20::2 $
# ping6 ipv6.google.com
unknown host
# strace -e connect ping6 ipv6.google.com
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("0.0.0.0")}, 28) = 0
unknown host
# 

I'd guess the extra white space causes the resolver to treat the entry as a hostname or some other invalid entry.

This caused me some confusion until I worked out I had an extra space at the end of the line, because the "dig" and "host" tools were working correctly (they don't use the glibc resolver).

Version-Release number of selected component (if applicable):
Seen in RHEL5.1 and RHEL5.4

How reproducible:
Always

Steps to Reproduce:
1. Enter a whitespace after the IPv6 address.
2. Try to ping6 a hostname
3.
  
Actual results:
"unknown host" and ping6 returns exit code 2.

Expected results:
Normal ping output.

Additional info:

Comment 1 Jeff Law 2012-02-10 03:17:34 UTC
It's a relatively simple fix to the parsing of the resolv.conf file.  I'm putting this in the queue of bugs to evaluate for Red Hat Enterprise Linux 5.9.

Comment 2 RHEL Program Management 2012-04-02 13:10:06 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 3 Jeff Law 2012-04-02 18:29:45 UTC
Note for QE; we fixed this in RHEL 6 (789189), and there's a TCMS testcase for
this bug that we can reuse.

Comment 6 Patsy Griffin 2012-06-12 02:25:23 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Same as RHEL 6.3 BZ 789189

Comment 8 errata-xmlrpc 2013-01-08 03:45:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0022.html


Note You need to log in before you can comment on or make changes to this bug.