Bug 168253 - glibc: support an arbitrary number of search domains in the stub resolver
glibc: support an arbitrary number of search domains in the stub resolver
Status: NEW
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Carlos O'Donell
Fedora Extras Quality Assurance
: FutureFeature, Reopened
Depends On:
  Show dependency treegraph
Reported: 2005-09-13 19:13 EDT by Jason Vas Dias
Modified: 2016-06-21 05:59 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-21 03:32:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 19569 None None None 2016-05-03 02:41 EDT

  None (edit)
Description Jason Vas Dias 2005-09-13 19:13:22 EDT
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):

How reproducible:

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
Expected results:
Hosts in the 7th domain should resolve fine 

Additional info:
Comment 1 Jakub Jelinek 2005-09-14 02:42:06 EDT
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
Comment 2 Dag Wieers 2013-09-17 11:39:01 EDT
Can you please open #677316 so we can see what it is about ?
Comment 3 Florian Weimer 2016-05-04 03:07:38 EDT
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.)

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