Bug 168253 - glibc: support an arbitrary number of search domains in the stub resolver
Summary: glibc: support an arbitrary number of search domains in the stub resolver
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Florian Weimer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 677316
TreeView+ depends on / blocked
 
Reported: 2005-09-13 23:13 UTC by Jason Vas Dias
Modified: 2021-06-10 10:36 UTC (History)
7 users (show)

Fixed In Version: glibc-2.25.90-18.fc27 glibc-2.25-12.fc26
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-12 10:52:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 19569 0 P2 RESOLVED resolv: Support an arbitrary number of search domains 2020-11-19 14:12:12 UTC
Sourceware 21885 0 P2 RESOLVED getaddrinfo: gethosts does not release resolver context on memory allocation failure 2020-11-19 14:12:13 UTC
Sourceware 21932 0 P2 RESOLVED Unpaired __resolv_context_get in generic get*_r implementation 2020-11-19 14:12:12 UTC

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.


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