Bug 168253

Summary: glibc: support an arbitrary number of search domains in the stub resolver
Product: [Fedora] Fedora Reporter: Jason Vas Dias <jvdias>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: cristi.falcas, dag, daniele, drepper, fweimer, gerhardus.geldenhuis, heri
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.25.90-18.fc27 glibc-2.25-12.fc26 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-12 10:52:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 677316    

Description Jason Vas Dias 2005-09-13 23:13:22 UTC
Description of problem:

The number of search path elements that can be in a resolv.conf "search" list
is too small - only 6 - and does not agree with the BIND resolver's maximum of
8 search list elements.

resolv.h has:
line 93: # define MAXDNSRCH  6   /* max # domains in search path */

while bind's lwres/lwres.h has:
line 217:# define LWRES_CONFMAXSEARCH 8   /* max 8 domains in "search" entry */

This can result in all glibc resolver linked tools failing to resolve a 
domain name that the bind-utils 'host' program can resolve fine.

Moreover, the documentation states that the maximum length of the search list
is 256; this is way too small, and should be at least (MAXDNSRCH * (255+1)) ,
since each component of the search list can be up to 255 chars, there must 
be one space char between each entry, and the terminating '\0'. 
BIND also has a 256 char maximum line length limit on resolv.conf lines.

Let's try to synch the behaviour of the glibc and BIND resolvers .

I suggest that a value of 6 search list components is too small for this 
very useful resolv.conf feature - so please can we increase it to at least 8,
or even 16, and consider increasing the maximum resolv.conf line length to 2048 
- then I'll increase bind's resolv.conf line length and maximum number of 
search path elements to whatever glibc's is.

I'd just like to suggest that this issue should be looked at as an enhancement
for a future release.

Version-Release number of selected component (if applicable):
ALL

How reproducible:
100%

Steps to Reproduce:
1. Put a search list with more than 6 elements in resolv.conf, eg.:
'
search boston.redhat.com lab.boston.redhat.com corp.redhat.com devel.redhat.com
build.redhat.com test.redhat.com redhat.com
'
2. Try to resolv a host in the 7th domain

Actual results:
# ping people
ping: unknown host people
# host people
people.redhat.com has address 172.16.48.237
  
Expected results:
Hosts in the 7th domain should resolve fine 

Additional info:

Comment 1 Jakub Jelinek 2005-09-14 06:42:06 UTC
This can't be changed in glibc, as it is part of user visible structure
(_res) that many programs are using.  Changing the constant would break binary
compatibility.

Comment 2 Dag Wieers 2013-09-17 15:39:01 UTC
Can you please open #677316 so we can see what it is about ?

Comment 3 Florian Weimer 2016-05-04 07:07:38 UTC
We are reconsidering this enhancement request to support deployments migrating from NIS host name lookups to DNS.

(There is a way to lift the limit in a way that does not impact ABI.)

Comment 4 Fedora Update System 2017-10-11 16:17:31 UTC
glibc-2.25-12.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-2c63df4fe3

Comment 5 Fedora Update System 2017-10-11 16:18:31 UTC
glibc-2.25-12.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-2c63df4fe3

Comment 6 Fedora Update System 2017-10-13 04:22:10 UTC
glibc-2.25-12.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-2c63df4fe3

Comment 7 Fedora Update System 2017-10-25 23:09:30 UTC
glibc-2.25-12.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.